From 72df476ada29f27741bde58b9974900f301156af Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Fri, 15 Oct 2021 21:18:29 +0800 Subject: [PATCH] TD-6129 support null true false for json tag --- src/client/src/tscUtil.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index b70d20bad1..e010738b2b 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -736,7 +736,11 @@ static void setResRawPtrImpl(SSqlRes* pRes, SInternalField* pInfo, int32_t i, bo tfree(json); } }else if (*p == SELECT_ELEMENT_JSON_TAG){ - parseTagValue2Dst(realData, dst); + if (isNull(realData, TSDB_DATA_TYPE_JSON)) { + memcpy(dst, realData, varDataTLen(realData)); + }else{ + parseTagValue2Dst(realData, dst); + } }else{ tscError("construct json error"); } @@ -5248,7 +5252,7 @@ char* parseTagDatatoJson(void *p){ continue; } if (j == 1 && *(uint8_t*)val == TSDB_DATA_JSON_NULL){ - break; + goto end; } if (j%2 == 0) { // json key encode by binary ASSERT(varDataLen(val) <= TSDB_MAX_JSON_KEY_LEN); -- GitLab