From 09c77f732ee6862b2c821684f09b13c30d1cf00b Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Mon, 27 Sep 2021 21:05:41 +0800 Subject: [PATCH] TD-6129 add tag-> where logic --- src/client/src/tscUtil.c | 4 ++-- src/common/inc/tdataformat.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 49394f50f2..0ccbcefbcb 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -5427,14 +5427,14 @@ void* getJsonTagValue(STable* pTable, char* key){ JsonMapValue* p = taosArraySearch(*data, &jmvalue, tsdbCompareJsonMapValue, TD_EQ); if (p == NULL) return NULL; int16_t colId = p->colId + 1; - return tdGetKVRowValOfCol(pTable, colId); + return tdGetKVRowValOfCol(pTable->tagVal, colId); }else if(TABLE_TYPE(pTable) == TSDB_SUPER_TABLE){ SArray** data = (SArray**)taosHashGet(pTable->jsonKeyMap, key, outLen); if(data == NULL) return NULL; if(taosArrayGetSize(*data) == 0) return NULL; JsonMapValue* p = taosArrayGet(*data, 0); int16_t colId = p->colId + 1; - return tdGetKVRowValOfCol((STable*)(p->table), colId); + return tdGetKVRowValOfCol(((STable*)(p->table))->tagVal, colId); } return NULL; } diff --git a/src/common/inc/tdataformat.h b/src/common/inc/tdataformat.h index f8cc374eb0..34fed5b3ba 100644 --- a/src/common/inc/tdataformat.h +++ b/src/common/inc/tdataformat.h @@ -473,7 +473,7 @@ static FORCE_INLINE int comparTagId(const void *key1, const void *key2) { } static FORCE_INLINE void *tdGetKVRowValOfCol(SKVRow row, int16_t colId) { - void *ret = taosbsearch(&colId, kvRowColIdx(row), kvRowNCols(row), sizeof(SColIdx), comparTagId, TD_EQ); + void *ret = taosbsearch(&colId, kvRowColIdx(row), p (row), sizeof(SColIdx), comparTagId, TD_EQ); if (ret == NULL) return NULL; return kvRowColVal(row, (SColIdx *)ret); } -- GitLab