diff --git a/source/client/src/tmq.c b/source/client/src/tmq.c index 2741ea0670..ad47348c22 100644 --- a/source/client/src/tmq.c +++ b/source/client/src/tmq.c @@ -2269,7 +2269,12 @@ static char *processAlterTable(SMqMetaRsp *metaRsp){ cJSON* tagName = cJSON_CreateString(vAlterTbReq.tagName); cJSON_AddItemToObject(json, "colName", tagName); - if (!vAlterTbReq.isNull){ + bool isNull = vAlterTbReq.isNull; + if(vAlterTbReq.tagType == TSDB_DATA_TYPE_JSON){ + STag *jsonTag = (STag *)vAlterTbReq.pTagVal; + if(jsonTag->nTag == 0) isNull = true; + } + if (!isNull){ char* buf = NULL; if (vAlterTbReq.tagType == TSDB_DATA_TYPE_JSON) { @@ -2285,8 +2290,8 @@ static char *processAlterTable(SMqMetaRsp *metaRsp){ taosMemoryFree(buf); } - cJSON* isNull = cJSON_CreateBool(vAlterTbReq.isNull); - cJSON_AddItemToObject(json, "colValueNull", isNull); + cJSON* isNullCJson = cJSON_CreateBool(isNull); + cJSON_AddItemToObject(json, "colValueNull", isNullCJson); break; } default: diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 6654bc26cd..a8fbc8d7ab 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -5872,9 +5872,6 @@ static int32_t buildUpdateTagValReq(STranslateContext* pCxt, SAlterTableStmt* pS if (code != TSDB_CODE_SUCCESS) { return code; } - if(pTag->nTag == 0){ - pReq->isNull = true; - } pReq->nTagVal = pTag->len; pReq->pTagVal = (uint8_t*)pTag; pStmt->pVal->datum.p = (char*)pTag; // for free