commit
cd2b053b85
|
@ -906,7 +906,7 @@ int32_t ctgEnqueue(SCatalog *pCtg, SCtgCacheOperation *operation) {
|
||||||
if (gCtgMgmt.queue.stopQueue) {
|
if (gCtgMgmt.queue.stopQueue) {
|
||||||
ctgFreeQNode(node);
|
ctgFreeQNode(node);
|
||||||
CTG_UNLOCK(CTG_WRITE, &gCtgMgmt.queue.qlock);
|
CTG_UNLOCK(CTG_WRITE, &gCtgMgmt.queue.qlock);
|
||||||
CTG_RET(TSDB_CODE_CTG_EXIT);
|
CTG_ERR_JRET(TSDB_CODE_CTG_EXIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
gCtgMgmt.queue.tail->next = node;
|
gCtgMgmt.queue.tail->next = node;
|
||||||
|
@ -924,7 +924,7 @@ int32_t ctgEnqueue(SCatalog *pCtg, SCtgCacheOperation *operation) {
|
||||||
code = tsem_post(&gCtgMgmt.queue.reqSem);
|
code = tsem_post(&gCtgMgmt.queue.reqSem);
|
||||||
if (TSDB_CODE_SUCCESS != code) {
|
if (TSDB_CODE_SUCCESS != code) {
|
||||||
qError("tsem_post failed, code:%x", code);
|
qError("tsem_post failed, code:%x", code);
|
||||||
CTG_RET(code);
|
CTG_ERR_JRET(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (syncOp) {
|
if (syncOp) {
|
||||||
|
@ -935,9 +935,15 @@ int32_t ctgEnqueue(SCatalog *pCtg, SCtgCacheOperation *operation) {
|
||||||
if (!operation->unLocked) {
|
if (!operation->unLocked) {
|
||||||
CTG_LOCK(CTG_READ, &gCtgMgmt.lock);
|
CTG_LOCK(CTG_READ, &gCtgMgmt.lock);
|
||||||
}
|
}
|
||||||
taosMemoryFree(operation);
|
TAOS_UNUSED(tsem_destroy(&operation->rspSem));
|
||||||
|
taosMemoryFreeClear(operation);
|
||||||
}
|
}
|
||||||
|
return code;
|
||||||
|
|
||||||
|
_return:
|
||||||
|
if (syncOp && operation) {
|
||||||
|
TAOS_UNUSED(tsem_destroy(&operation->rspSem));
|
||||||
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -742,6 +742,20 @@ char *tz_win[554][2] = {{"Asia/Shanghai", "China Standard Time"},
|
||||||
|
|
||||||
static int isdst_now = 0;
|
static int isdst_now = 0;
|
||||||
|
|
||||||
|
void parseTimeStr(char *p, char to[5]) {
|
||||||
|
for (int i = 0; i < 5; ++i) {
|
||||||
|
if (strlen(p) > i) {
|
||||||
|
to[i] = p[i];
|
||||||
|
} else {
|
||||||
|
to[i] = '0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (strlen(p) == 2) {
|
||||||
|
to[1] = '0';
|
||||||
|
to[2] = p[1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int32_t taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, int8_t *outDaylight,
|
int32_t taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, int8_t *outDaylight,
|
||||||
enum TdTimezone *tsTimezone) {
|
enum TdTimezone *tsTimezone) {
|
||||||
if (inTimezoneStr == NULL || inTimezoneStr[0] == 0) {
|
if (inTimezoneStr == NULL || inTimezoneStr[0] == 0) {
|
||||||
|
@ -798,7 +812,9 @@ int32_t taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, i
|
||||||
memcpy(&winStr[3], pp, ppp - pp);
|
memcpy(&winStr[3], pp, ppp - pp);
|
||||||
indexStr = ppp - pp + 3;
|
indexStr = ppp - pp + 3;
|
||||||
}
|
}
|
||||||
sprintf(&winStr[indexStr], "%c%c%c:%c%c:00", (p[0] == '+' ? '+' : '-'), p[1], p[2], p[3], p[4]);
|
char to[5];
|
||||||
|
parseTimeStr(p, to);
|
||||||
|
sprintf(&winStr[indexStr], "%c%c%c:%c%c:00", (to[0] == '+' ? '+' : '-'), to[1], to[2], to[3], to[4]);
|
||||||
*tsTimezone = -taosStr2Int32(p, NULL, 10);
|
*tsTimezone = -taosStr2Int32(p, NULL, 10);
|
||||||
} else {
|
} else {
|
||||||
*tsTimezone = 0;
|
*tsTimezone = 0;
|
||||||
|
@ -806,7 +822,9 @@ int32_t taosSetSystemTimezone(const char *inTimezoneStr, char *outTimezoneStr, i
|
||||||
}
|
}
|
||||||
_putenv(winStr);
|
_putenv(winStr);
|
||||||
_tzset();
|
_tzset();
|
||||||
|
if (outTimezoneStr != inTimezoneStr) {
|
||||||
strcpy(outTimezoneStr, inTimezoneStr);
|
strcpy(outTimezoneStr, inTimezoneStr);
|
||||||
|
}
|
||||||
*outDaylight = 0;
|
*outDaylight = 0;
|
||||||
|
|
||||||
#elif defined(_TD_DARWIN_64)
|
#elif defined(_TD_DARWIN_64)
|
||||||
|
|
Loading…
Reference in New Issue