From 3923feeba74d7711472f52fa05f7ec8e8fe94eba Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Fri, 13 Dec 2024 19:02:44 +0800 Subject: [PATCH 1/4] fix:[TD-32642] set code to terrno --- source/client/src/clientMain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index d80c7df2e4..8d19cd6237 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -122,23 +122,23 @@ END: static int32_t setConnectionOption(TAOS *taos, TSDB_OPTION_CONNECTION option, const char* val){ if (taos == NULL) { - return TSDB_CODE_INVALID_PARA; + return terrno = TSDB_CODE_INVALID_PARA; } #ifdef WINDOWS if (option == TSDB_OPTION_CONNECTION_TIMEZONE){ - return TSDB_CODE_NOT_SUPPORTTED_IN_WINDOWS; + return terrno = TSDB_CODE_NOT_SUPPORTTED_IN_WINDOWS; } #endif if (option < TSDB_OPTION_CONNECTION_CLEAR || option >= TSDB_MAX_OPTIONS_CONNECTION){ - return TSDB_CODE_INVALID_PARA; + return terrno = TSDB_CODE_INVALID_PARA; } int32_t code = taos_init(); // initialize global config if (code != 0) { - return code; + return terrno = code; } STscObj *pObj = acquireTscObj(*(int64_t *)taos); @@ -208,7 +208,7 @@ static int32_t setConnectionOption(TAOS *taos, TSDB_OPTION_CONNECTION option, co END: releaseTscObj(*(int64_t *)taos); - return code; + return terrno = code; } int taos_options_connection(TAOS *taos, TSDB_OPTION_CONNECTION option, const void *arg, ...){ From 0f67d9c314658b5fb8a8bebd0c2bc3f011108b75 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Mon, 16 Dec 2024 10:00:57 +0800 Subject: [PATCH 2/4] merge: set taos-tools tags --- cmake/taosadapter_CMakeLists.txt.in | 2 +- cmake/taostools_CMakeLists.txt.in | 2 +- cmake/taosws_CMakeLists.txt.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/taosadapter_CMakeLists.txt.in b/cmake/taosadapter_CMakeLists.txt.in index 13826a1a74..ef6ed4af1d 100644 --- a/cmake/taosadapter_CMakeLists.txt.in +++ b/cmake/taosadapter_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosadapter ExternalProject_Add(taosadapter GIT_REPOSITORY https://github.com/taosdata/taosadapter.git - GIT_TAG main + GIT_TAG 3.0 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosadapter" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/cmake/taostools_CMakeLists.txt.in b/cmake/taostools_CMakeLists.txt.in index 9bbda8309f..9a6a5329ae 100644 --- a/cmake/taostools_CMakeLists.txt.in +++ b/cmake/taostools_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taos-tools ExternalProject_Add(taos-tools GIT_REPOSITORY https://github.com/taosdata/taos-tools.git - GIT_TAG main + GIT_TAG 3.0 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taos-tools" BINARY_DIR "" #BUILD_IN_SOURCE TRUE diff --git a/cmake/taosws_CMakeLists.txt.in b/cmake/taosws_CMakeLists.txt.in index b013d45911..17446d184d 100644 --- a/cmake/taosws_CMakeLists.txt.in +++ b/cmake/taosws_CMakeLists.txt.in @@ -2,7 +2,7 @@ # taosws-rs ExternalProject_Add(taosws-rs GIT_REPOSITORY https://github.com/taosdata/taos-connector-rust.git - GIT_TAG main + GIT_TAG 3.0 SOURCE_DIR "${TD_SOURCE_DIR}/tools/taosws-rs" BINARY_DIR "" #BUILD_IN_SOURCE TRUE From 6a633fa9d5a4d1975fa631310d003707245993db Mon Sep 17 00:00:00 2001 From: xiao-77 Date: Mon, 16 Dec 2024 14:08:14 +0800 Subject: [PATCH 3/4] Fix ci problems. --- source/util/src/tconfig.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/util/src/tconfig.c b/source/util/src/tconfig.c index a2e874aabf..b91334944d 100644 --- a/source/util/src/tconfig.c +++ b/source/util/src/tconfig.c @@ -475,7 +475,13 @@ int32_t cfgSetItem(SConfig *pCfg, const char *name, const char *value, ECfgSrcTy TAOS_RETURN(TSDB_CODE_CFG_NOT_FOUND); } - TAOS_CHECK_RETURN(cfgSetItemVal(pItem, name, value, stype)); + code = cfgSetItemVal(pItem, name, value, stype); + if (code != TSDB_CODE_SUCCESS) { + if (lock) { + (void)taosThreadMutexUnlock(&pCfg->lock); + } + TAOS_RETURN(code); + } if (lock) { (void)taosThreadMutexUnlock(&pCfg->lock); From 5177a76b9af3391a430ad431d606c76087223b49 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Mon, 16 Dec 2024 17:46:33 +0800 Subject: [PATCH 4/4] fix:[TD-32642] process return code --- source/client/src/clientMain.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/client/src/clientMain.c b/source/client/src/clientMain.c index f576c44b09..2f2ccb12fe 100644 --- a/source/client/src/clientMain.c +++ b/source/client/src/clientMain.c @@ -109,8 +109,10 @@ static timezone_t setConnnectionTz(const char* val){ time_t tx1 = taosGetTimestampSec(); char output[TD_TIMEZONE_LEN] = {0}; - taosFormatTimezoneStr(tx1, val, tz, output); - code = taosHashPut(pTimezoneNameMap, &tz, sizeof(timezone_t), output, strlen(output) + 1); + code = taosFormatTimezoneStr(tx1, val, tz, output); + if (code == 0){ + code = taosHashPut(pTimezoneNameMap, &tz, sizeof(timezone_t), output, strlen(output) + 1); + } if (code != 0){ tscError("failed to put timezone %s to map", val); }