提交 cffb8cfa 编写于 作者: G Ganlin Zhao

[TD-10438]<fix>: OpenTSDB duplicated JSON ids should return error

上级 fcb34ff8
......@@ -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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册