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

[TD-5992] add set config interface for connector

上级 0023172c
......@@ -124,7 +124,7 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry
static pthread_mutex_t setConfMutex = PTHREAD_MUTEX_INITIALIZER;
static bool setConfFlag = false;
int taos_set_config(const char *config){
if(taos_init() == false){
if(taos_init()){
tscError("failed to call taos_init");
return -1;
}
......@@ -150,6 +150,7 @@ int taos_set_config(const char *config){
}
taosReadConfigOption(item->string, item->valuestring, NULL, NULL);
}
taosPrintGlobalCfg();
setConfFlag = true;
pthread_mutex_unlock(&setConfMutex);
return 0;
......
......@@ -262,8 +262,9 @@ 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);
const char *config = "{\"tempDir\":\"/root/tmp/\",\"serverPort\":\"3333\"}";
taos_set_config(config);
taos_set_config(config);
validateResultFields();
stmtInsertTest();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册