From 0e1fab65e1137b520b1f8b5de98f9f0b856345ed Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Sat, 18 Sep 2021 15:02:07 +0800 Subject: [PATCH] TD-6129 fix json encode error --- src/tsdb/src/tsdbRead.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 19f7f413a4..5bcddff18f 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -2678,12 +2678,13 @@ static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int static int32_t getAllTableList(STable* pSuperTable, SArray* list) { STSchema* pTagSchema = tsdbGetTableTagSchema(pSuperTable); if(pTagSchema->numOfCols == 1 && pTagSchema->columns[0].type == TSDB_DATA_TYPE_JSON){ - SArray* pRecord = taosHashIterate(pSuperTable->jsonKeyMap, NULL); + SArray** pRecord = taosHashIterate(pSuperTable->jsonKeyMap, NULL); SArray* tablist = taosArrayInit(32, sizeof(JsonMapValue)); while(pRecord){ - for (int i = 0; i < taosArrayGetSize(pRecord); ++i) { - void* p = taosArrayGet(pRecord, i); + SArray* tallistOld = *pRecord; + for (int i = 0; i < taosArrayGetSize(tallistOld); ++i) { + void* p = taosArrayGet(tallistOld, i); void* pFind = taosArraySearch(tablist, p, tscCompareJsonMapValue, TD_EQ); if(pFind == NULL){ taosArrayPush(tablist, p); -- GitLab