diff --git a/source/client/src/tmq.c b/source/client/src/tmq.c index 4dc0dbfa64..5f0fcf1d78 100644 --- a/source/client/src/tmq.c +++ b/source/client/src/tmq.c @@ -2101,8 +2101,10 @@ static char *buildCreateCTableJson(STag* pTag, char* sname, char* name, int64_t cJSON* tag = cJSON_CreateObject(); STagVal* pTagVal = taosArrayGet(pTagVals, 0); - cJSON* tname = cJSON_CreateString(pTagVal->colName); - cJSON_AddItemToObject(tag, "name", tname); +// cJSON* tname = cJSON_CreateString(pTagVal->colName); +// cJSON_AddItemToObject(tag, "name", tname); + cJSON* cid_ = cJSON_CreateString(""); + cJSON_AddItemToObject(tag, "cid", cid_); cJSON* ttype = cJSON_CreateNumber(TSDB_DATA_TYPE_JSON); cJSON_AddItemToObject(tag, "type", ttype); cJSON* tvalue = cJSON_CreateString(pJson); @@ -2116,8 +2118,11 @@ static char *buildCreateCTableJson(STag* pTag, char* sname, char* name, int64_t STagVal* pTagVal = (STagVal*)taosArrayGet(pTagVals, i); cJSON* tag = cJSON_CreateObject(); - cJSON* tname = cJSON_CreateString(pTagVal->colName); - cJSON_AddItemToObject(tag, "name", tname); + + char cid[32] = {0}; + sprintf(cid, "%d", pTagVal->cid); + cJSON* cid_ = cJSON_CreateString(cid); + cJSON_AddItemToObject(tag, "cid", cid_); cJSON* ttype = cJSON_CreateNumber(pTagVal->type); cJSON_AddItemToObject(tag, "type", ttype); diff --git a/source/libs/parser/src/parInsert.c b/source/libs/parser/src/parInsert.c index 576dc6d8d3..ad0877476d 100644 --- a/source/libs/parser/src/parInsert.c +++ b/source/libs/parser/src/parInsert.c @@ -837,7 +837,7 @@ static int32_t parseTagToken(char** end, SToken* pToken, SSchema* pSchema, int16 return TSDB_CODE_SUCCESS; } - strcpy(val->colName, pSchema->name); +// strcpy(val->colName, pSchema->name); val->cid = pSchema->colId; val->type = pSchema->type; @@ -1910,7 +1910,7 @@ int32_t qBindStmtTagsValue(void* pBlock, void* boundTags, int64_t suid, const ch } } else { STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; - strcpy(val.colName, pTagSchema->name); +// strcpy(val.colName, pTagSchema->name); if (pTagSchema->type == TSDB_DATA_TYPE_BINARY) { val.pData = (uint8_t*)bind[c].buffer; val.nData = colLen; @@ -2311,7 +2311,7 @@ static int32_t smlBuildTagRow(SArray* cols, SParsedDataColInfo* tags, SSchema* p SSmlKv* kv = taosArrayGetP(cols, i); STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; - strcpy(val.colName, pTagSchema->name); +// strcpy(val.colName, pTagSchema->name); if (pTagSchema->type == TSDB_DATA_TYPE_BINARY) { val.pData = (uint8_t*)kv->value; val.nData = kv->length; diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index a03cdb6485..75fc2b71dc 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -5555,7 +5555,7 @@ static int32_t buildNormalTagVal(STranslateContext* pCxt, SSchema* pTagSchema, S if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL) { void* nodeVal = nodesGetValueFromNode(pVal); STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; - strcpy(val.colName, pTagSchema->name); +// strcpy(val.colName, pTagSchema->name); if (IS_VAR_DATA_TYPE(pTagSchema->type)) { val.pData = varDataVal(nodeVal); val.nData = varDataLen(nodeVal); @@ -5649,7 +5649,7 @@ static int32_t buildKVRowForAllTags(STranslateContext* pCxt, SCreateSubTableClau } else if (pVal->node.resType.type != TSDB_DATA_TYPE_NULL && !pVal->isNull) { char* tmpVal = nodesGetValueFromNode(pVal); STagVal val = {.cid = pTagSchema->colId, .type = pTagSchema->type}; - strcpy(val.colName, pTagSchema->name); +// strcpy(val.colName, pTagSchema->name); if (IS_VAR_DATA_TYPE(pTagSchema->type)) { val.pData = varDataVal(tmpVal); val.nData = varDataLen(tmpVal); diff --git a/source/libs/parser/src/parUtil.c b/source/libs/parser/src/parUtil.c index 2f12c9adf6..b6ebb0de22 100644 --- a/source/libs/parser/src/parUtil.c +++ b/source/libs/parser/src/parUtil.c @@ -389,7 +389,7 @@ int32_t parseJsontoTagData(const char* json, SArray* pTagVals, STag** ppTag, voi continue; } STagVal val = {0}; - strcpy(val.colName, colName); +// strcpy(val.colName, colName); val.pKey = jsonKey; taosHashPut(keyHash, jsonKey, keyLen, &keyLen, CHAR_BYTES); // add key to hash to remove dumplicate, value is useless