diff --git a/src/storage/src/base_value_format.h b/src/storage/src/base_value_format.h index f579c81842..f2817c8fcb 100644 --- a/src/storage/src/base_value_format.h +++ b/src/storage/src/base_value_format.h @@ -18,7 +18,7 @@ namespace storage { -enum class DataType : uint8_t { kStrings = 0, kHashes = 1, kSets = 2, kLists = 3, kZSets = 4, kStreams = 5, kHyperloglog = 6, kNones = 7, kAll = 8}; +enum class DataType : uint8_t { kStrings = 0, kHashes = 1, kSets = 2, kLists = 3, kZSets = 4, kStreams = 5, kHyperloglog = 8, kNones = 6, kAll = 7}; constexpr char DataTypeTag[] = { 'k', 'h', 's', 'l', 'z', 'x', 'p', 'n', 'a'};//p means hyperloglog constexpr char* DataTypeStrings[] = { "string", "hash", "set", "list", "zset", "streams", "hyperloglog", "none", "all"}; diff --git a/src/storage/src/redis_hyperloglog.cc b/src/storage/src/redis_hyperloglog.cc index eb2b95c38e..57481c3669 100644 --- a/src/storage/src/redis_hyperloglog.cc +++ b/src/storage/src/redis_hyperloglog.cc @@ -20,6 +20,7 @@ #include "storage/util.h" #include "src/redis_hyperloglog.h" #include "src/storage_murmur3.h" +#include "pstd_defer.h" #include "src/hyperloglog_value_format.h" @@ -232,9 +233,9 @@ void Redis::ScanHyperloglog() { LOG(INFO) << "***************" << "rocksdb instance: " << index_ << " " << "Hyperloglog Data***************"; auto iter = db_->NewIterator(iterator_options); - DEFER() { + DEFER { delete iter; - } + }; for (iter->SeekToFirst(); iter->Valid(); iter->Next()) { if (!ExpectedMetaValue(DataType::kHyperloglog, iter->value().ToString())) { continue;