提交 877266cd 编写于 作者: wmmhello's avatar wmmhello

TD-6129<feature> add json tag support

上级 9a1b8940
......@@ -1477,39 +1477,6 @@ static bool validateTableColumnInfo(SArray* pFieldList, SSqlCmd* pCmd) {
return true;
}
static bool validataTagJson(char *json){
const char* msg1 = "json parse error";
cJSON *root = cJSON_Parse(json);
if (root == NULL){
tscError("json parse error : %s", json);
return false;
}
bool returnVal = true;
int size = cJSON_GetArraySize(root);
if(!cJSON_IsObject(root) || size == 0){
tscError("json error invalide value");
}
for(int i = 0; i < size; i++) {
cJSON* item = cJSON_GetArrayItem(root, i);
if (!item) {
tscError("json inner error:%d", i);
returnVal = false;
goto end;
}
if(item->type != cJSON_String && item->type != cJSON_Number){
tscError("json value unsupport:%d", item->type);
returnVal = false;
goto end;
}
}
end:
cJSON_Delete(root);
return returnVal;
}
static bool validateTagParams(SArray* pTagsList, SArray* pFieldList, SSqlCmd* pCmd) {
assert(pTagsList != NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册