Merge branch '3.0' into merge/mainto3.0

This commit is contained in:
Shengliang Guan 2024-12-17 11:43:51 +08:00
commit cd8ea881cf
2 changed files with 12 additions and 10 deletions

View File

@ -109,8 +109,10 @@ static timezone_t setConnnectionTz(const char* val){
time_t tx1 = taosGetTimestampSec(); time_t tx1 = taosGetTimestampSec();
char output[TD_TIMEZONE_LEN] = {0}; char output[TD_TIMEZONE_LEN] = {0};
taosFormatTimezoneStr(tx1, val, tz, output); code = taosFormatTimezoneStr(tx1, val, tz, output);
code = taosHashPut(pTimezoneNameMap, &tz, sizeof(timezone_t), output, strlen(output) + 1); if (code == 0){
code = taosHashPut(pTimezoneNameMap, &tz, sizeof(timezone_t), output, strlen(output) + 1);
}
if (code != 0){ if (code != 0){
tscError("failed to put timezone %s to map", val); tscError("failed to put timezone %s to map", val);
} }
@ -122,23 +124,23 @@ END:
static int32_t setConnectionOption(TAOS *taos, TSDB_OPTION_CONNECTION option, const char* val){ static int32_t setConnectionOption(TAOS *taos, TSDB_OPTION_CONNECTION option, const char* val){
if (taos == NULL) { if (taos == NULL) {
return TSDB_CODE_INVALID_PARA; return terrno = TSDB_CODE_INVALID_PARA;
} }
#ifdef WINDOWS #ifdef WINDOWS
if (option == TSDB_OPTION_CONNECTION_TIMEZONE){ if (option == TSDB_OPTION_CONNECTION_TIMEZONE){
return TSDB_CODE_NOT_SUPPORTTED_IN_WINDOWS; return terrno = TSDB_CODE_NOT_SUPPORTTED_IN_WINDOWS;
} }
#endif #endif
if (option < TSDB_OPTION_CONNECTION_CLEAR || option >= TSDB_MAX_OPTIONS_CONNECTION){ 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(); int32_t code = taos_init();
// initialize global config // initialize global config
if (code != 0) { if (code != 0) {
return code; return terrno = code;
} }
STscObj *pObj = acquireTscObj(*(int64_t *)taos); STscObj *pObj = acquireTscObj(*(int64_t *)taos);
@ -208,7 +210,7 @@ static int32_t setConnectionOption(TAOS *taos, TSDB_OPTION_CONNECTION option, co
END: END:
releaseTscObj(*(int64_t *)taos); releaseTscObj(*(int64_t *)taos);
return code; return terrno = code;
} }
int taos_options_connection(TAOS *taos, TSDB_OPTION_CONNECTION option, const void *arg, ...){ int taos_options_connection(TAOS *taos, TSDB_OPTION_CONNECTION option, const void *arg, ...){

View File

@ -39,7 +39,7 @@ static FORCE_INLINE int32_t stmtAllocQNodeFromBuf(STableBufInfo* pTblBuf, void**
} }
static bool stmtDequeue(STscStmt2* pStmt, SStmtQNode** param) { static bool stmtDequeue(STscStmt2* pStmt, SStmtQNode** param) {
while (0 == atomic_load_64(&pStmt->queue.qRemainNum)) { while (0 == atomic_load_64((int64_t*)&pStmt->queue.qRemainNum)) {
taosUsleep(1); taosUsleep(1);
return false; return false;
} }
@ -53,7 +53,7 @@ static bool stmtDequeue(STscStmt2* pStmt, SStmtQNode** param) {
*param = node; *param = node;
(void)atomic_sub_fetch_64(&pStmt->queue.qRemainNum, 1); (void)atomic_sub_fetch_64((int64_t*)&pStmt->queue.qRemainNum, 1);
return true; return true;
} }
@ -63,7 +63,7 @@ static void stmtEnqueue(STscStmt2* pStmt, SStmtQNode* param) {
pStmt->queue.tail = param; pStmt->queue.tail = param;
pStmt->stat.bindDataNum++; pStmt->stat.bindDataNum++;
(void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); (void)atomic_add_fetch_64((int64_t*)&pStmt->queue.qRemainNum, 1);
} }
static int32_t stmtCreateRequest(STscStmt2* pStmt) { static int32_t stmtCreateRequest(STscStmt2* pStmt) {