diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c index f7e0979bdd0176840b0285771666aeac7e21122a..884c172577d0a4c7da0b70e0a23857c6e3a90ea3 100644 --- a/src/client/src/tscSystem.c +++ b/src/client/src/tscSystem.c @@ -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; diff --git a/src/client/tests/cliTest.cpp b/src/client/tests/cliTest.cpp index d8f155c08876aaf6eb1f1394fbdc53c37230cda3..99bd258c04bdb455d35ec5a9154d62e73db15585 100644 --- a/src/client/tests/cliTest.cpp +++ b/src/client/tests/cliTest.cpp @@ -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(); }