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

[TD-5992] add set config interface for connector

上级 d9b1a241
......@@ -2,6 +2,7 @@ EXPORTS
taos_init
taos_cleanup
taos_options
taos_set_config
taos_connect
taos_connect_auth
taos_close
......
......@@ -262,8 +262,8 @@ TEST(testCase, result_field_test) {
taos_options(TSDB_OPTION_CONFIGDIR, "~/first/cfg");
taos_init();
char *config = "{\"tempDir\":\"/root/tmp/\",\"sercerPort\":\"3333\"}";
taos_set_config(config);
//char *config = "{\"tempDir:\"/root/tmp/\",\"sercerPort\":\"3333\"}";
//taos_set_config(config);
validateResultFields();
stmtInsertTest();
}
......@@ -574,7 +574,10 @@ int taos_set_config(const char *config){
pthread_mutex_lock(&setConfMutex);
if (setConfFlag) return;
if (setConfFlag) {
uError("already set config");
return 0;
}
cJSON *root = cJSON_Parse(config);
if (root == NULL) {
uError("failed to set config, invalid json format: %s", config);
......@@ -592,4 +595,5 @@ int taos_set_config(const char *config){
}
setConfFlag = true;
pthread_mutex_unlock(&setConfMutex);
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册