diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index e4bf594dc8d8a57c41315d57d885ec9e3c322da9..efe52ac8dc34629f364d2cb58594a0945868203a 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){