From 53bcb31c503b32d1f325e5dbac1f49add7b60728 Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 19 Oct 2021 10:05:34 +0800 Subject: [PATCH] fix json null data format error --- src/client/src/tscUtil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index e4bf594dc8..efe52ac8dc 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -5223,7 +5223,7 @@ char* parseTagDatatoJson(void *p){ continue; } if (j == 2){ - if(*(uint8_t*)(varDataVal(val)) == TSDB_DATA_JSON_NULL) goto end; + if(*(uint8_t*)(varDataVal(val + CHAR_BYTES)) == TSDB_DATA_JSON_NULL) goto end; continue; } if (j%2 == 1) { // json key encode by binary @@ -5290,6 +5290,7 @@ int parseJsontoTagData(char* json, SKVRowBuilder* kvRowBuilder, char* errMsg, in int jsonIndex = startColId + 1; char nullTypeKey[VARSTR_HEADER_SIZE + CHAR_BYTES] = {0}; varDataSetLen(nullTypeKey, CHAR_BYTES); + varDataSetLen(nullTypeVal + CHAR_BYTES, CHAR_BYTES); *(uint8_t*)(varDataVal(nullTypeKey)) = jsonNULL; tdAddColToKVRow(kvRowBuilder, jsonIndex++, TSDB_DATA_TYPE_NCHAR, nullTypeKey, false); // add json null type if (strtrim(json) == 0 || strcasecmp(json, "null") == 0){ -- GitLab