From 4af0ba9e9931a43e4ec4cbea182cf2350748550c Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 17 Sep 2021 15:48:28 +0800 Subject: [PATCH] TD-6129 fix json encode error --- src/kit/shell/src/shellEngine.c | 6 ++++++ src/tsdb/src/tsdbMeta.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 4dfe424b11..53a07380cf 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -797,6 +797,12 @@ static int calcColWidth(TAOS_FIELD* field, int precision) { return MAX(bytes, width); } } + case TSDB_DATA_TYPE_JSON: + if (field->bytes > tsMaxBinaryDisplayWidth) { + return MAX(tsMaxBinaryDisplayWidth, width); + } else { + return MAX(field->bytes, width); + } case TSDB_DATA_TYPE_TIMESTAMP: if (args.is_raw_time) { diff --git a/src/tsdb/src/tsdbMeta.c b/src/tsdb/src/tsdbMeta.c index 23db395de9..d9535c50d4 100644 --- a/src/tsdb/src/tsdbMeta.c +++ b/src/tsdb/src/tsdbMeta.c @@ -1106,7 +1106,7 @@ static int tsdbAddTableIntoIndex(STsdbMeta *pMeta, STable *pTable, bool refSuper continue; } - void* tablist = taosHashGet(pSTable->jsonKeyMap, varDataVal(val) ,varDataLen(val)); + void* tablist = taosHashGet(pSTable->jsonKeyMap, varDataVal(val), varDataLen(val)); if(tablist == NULL) { void* tablistNew = taosArrayInit(8, sizeof(JsonMapValue)); if(tablistNew == NULL){ -- GitLab