diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 321137cb6b4ab6ba5176196ac929ca50fd1ae10b..2863ff4c9bbdc99f6fb8c8da2691a65a0824b123 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)){