From 84cae91f9fe8c2fd8e80d24049bcd57d499dee72 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 25 Apr 2023 09:39:57 +0000 Subject: [PATCH] rocksdb_iter_value --- source/libs/stream/src/streamStateRocksdb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/libs/stream/src/streamStateRocksdb.c b/source/libs/stream/src/streamStateRocksdb.c index 76742ae39c..bdec2f90ab 100644 --- a/source/libs/stream/src/streamStateRocksdb.c +++ b/source/libs/stream/src/streamStateRocksdb.c @@ -45,8 +45,9 @@ int streamStateValueIsStale(char* vv) { return ts < taosGetTimestampSec() ? 1 : 0; } int iterValueIsStale(rocksdb_iterator_t* iter) { - char* vv = (char*)rocksdb_iter_value(iter, NULL); - return streamStateValueIsStale(vv); + size_t len; + char* v = (char*)rocksdb_iter_value(iter, &len); + return streamStateValueIsStale(v); } int defaultKeyEncode(void* k, char* buf) { int len = strlen((char*)k); @@ -997,7 +998,8 @@ SStreamStateCur* streamStateGetCur_rocksdb(SStreamState* pState, const SWinKey* rocksdb_iter_seek(pCur->iter, buf, len); if (rocksdb_iter_valid(pCur->iter) && !iterValueIsStale(pCur->iter)) { - char* val = (char*)rocksdb_iter_value(pCur->iter, NULL); + size_t vlen; + char* val = (char*)rocksdb_iter_value(pCur->iter, &vlen); if (!streamStateValueIsStale(val)) { SStateKey curKey; size_t kLen = 0; -- GitLab