diff --git a/src/client/src/tscParseOpenTSDB.c b/src/client/src/tscParseOpenTSDB.c index 14693ae361b533287e3377e644908c5c8a613c79..48c979306bcf1ae9f12a1e1af3e1c79f22656e99 100644 --- a/src/client/src/tscParseOpenTSDB.c +++ b/src/client/src/tscParseOpenTSDB.c @@ -831,10 +831,12 @@ int32_t parseTagsFromJSON(cJSON *root, TAOS_SML_KV **pKVs, int *num_kvs, char ** } *childTableName = tcalloc(idLen + 1, sizeof(char)); memcpy(*childTableName, id->valuestring, idLen); - //remove all ID fields from tags list no case sensitive - while (id != NULL) { - cJSON_DeleteItemFromObject(tags, "ID"); - id = cJSON_GetObjectItem(tags, "ID"); + + //If there's duplicate ID fields in tags return error + cJSON_DeleteItemFromObject(tags, "ID"); + id = cJSON_GetObjectItem(tags, "ID"); + if (id != NULL) { + return TSDB_CODE_TSC_DUP_TAG_NAMES; } }