From 3d868b5bb9c5b052c166566ada48b1c9ea22e6cc Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Wed, 1 Dec 2021 15:23:32 +0800 Subject: [PATCH] enable different value type of the same key in json --- src/client/src/tscSQLParser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 321137cb6b..2863ff4c9b 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -4741,7 +4741,7 @@ static int32_t validateJsonTagExpr(tSqlExpr* pExpr, char* msgBuf) { return invalidOperationMsg(msgBuf, msg2); } - if (pRight->value.nType == TSDB_DATA_TYPE_BINARY){ // json value store by nchar, so need to convert to nchar + if (pRight->value.nType == TSDB_DATA_TYPE_BINARY && *(uint32_t*)pRight->value.pz != TSDB_DATA_JSON_null){ // json value store by nchar, so need to convert to nchar char newData[TSDB_MAX_JSON_TAGS_LEN] = {0}; int len = 0; if(!taosMbsToUcs4(pRight->value.pz, pRight->value.nLen, newData, TSDB_MAX_JSON_TAGS_LEN, &len)){ -- GitLab