[TBASE-1155]
This commit is contained in:
parent
32c5c18c3f
commit
95955cb474
|
@ -243,10 +243,6 @@ int taosInitTimer(void (*callback)(int), int ms) {
|
||||||
return setitimer(ITIMER_REAL, &tv, NULL);
|
return setitimer(ITIMER_REAL, &tv, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *taosCharsetReplace(char *charsetstr) {
|
|
||||||
return charsetstr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void taosGetSystemTimezone() {
|
void taosGetSystemTimezone() {
|
||||||
// get and set default timezone
|
// get and set default timezone
|
||||||
SGlobalConfig *cfg_timezone = tsGetConfigOption("timezone");
|
SGlobalConfig *cfg_timezone = tsGetConfigOption("timezone");
|
||||||
|
@ -416,3 +412,11 @@ int tsem_post(dispatch_semaphore_t *sem) {
|
||||||
int tsem_destroy(dispatch_semaphore_t *sem) {
|
int tsem_destroy(dispatch_semaphore_t *sem) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t __sync_val_load_32(int32_t *ptr) {
|
||||||
|
return __atomic_load_n(ptr, __ATOMIC_ACQUIRE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __sync_val_restore_32(int32_t *ptr, int32_t newval) {
|
||||||
|
__atomic_store_n(ptr, newval, __ATOMIC_RELEASE);
|
||||||
|
}
|
|
@ -210,25 +210,6 @@ void taosGetSystemTimezone() {
|
||||||
pPrint("timezone not configured, set to system default:%s", tsTimezone);
|
pPrint("timezone not configured, set to system default:%s", tsTimezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct CharsetPair {
|
|
||||||
char *oldCharset;
|
|
||||||
char *newCharset;
|
|
||||||
} CharsetPair;
|
|
||||||
|
|
||||||
char *taosCharsetReplace(char *charsetstr) {
|
|
||||||
CharsetPair charsetRep[] = {
|
|
||||||
{"utf8", "UTF-8"}, {"936", "CP936"},
|
|
||||||
};
|
|
||||||
|
|
||||||
for (int32_t i = 0; i < tListLen(charsetRep); ++i) {
|
|
||||||
if (strcasecmp(charsetRep[i].oldCharset, charsetstr) == 0) {
|
|
||||||
return strdup(charsetRep[i].newCharset);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return strdup(charsetstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* POSIX format locale string:
|
* POSIX format locale string:
|
||||||
* (Language Strings)_(Country/Region Strings).(code_page)
|
* (Language Strings)_(Country/Region Strings).(code_page)
|
||||||
|
|
|
@ -205,10 +205,6 @@ __int64 interlocked_fetch_xor_64(__int64 volatile* ptr, __int64 val) {
|
||||||
|
|
||||||
void tsPrintOsInfo() {}
|
void tsPrintOsInfo() {}
|
||||||
|
|
||||||
char *taosCharsetReplace(char *charsetstr) {
|
|
||||||
return charsetstr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void taosGetSystemTimezone() {
|
void taosGetSystemTimezone() {
|
||||||
// get and set default timezone
|
// get and set default timezone
|
||||||
SGlobalConfig *cfg_timezone = tsGetConfigOption("timezone");
|
SGlobalConfig *cfg_timezone = tsGetConfigOption("timezone");
|
||||||
|
|
|
@ -546,6 +546,7 @@ int vnodeImportToCache(SImportInfo *pImport, char *payload, int rows) {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(rows);
|
||||||
dTrace("vid:%d sid:%d id:%s, %d rows data will be imported to cache, firstKey:%ld lastKey:%ld",
|
dTrace("vid:%d sid:%d id:%s, %d rows data will be imported to cache, firstKey:%ld lastKey:%ld",
|
||||||
pObj->vnode, pObj->sid, pObj->meterId, rows, firstKey, lastKey);
|
pObj->vnode, pObj->sid, pObj->meterId, rows, firstKey, lastKey);
|
||||||
|
|
||||||
|
@ -781,7 +782,7 @@ int vnodeImportStartToCache(SImportInfo *pImport, char *payload, int rows) {
|
||||||
pImport->importedRows = rows;
|
pImport->importedRows = rows;
|
||||||
code = vnodeImportToCache(pImport, payload, rows);
|
code = vnodeImportToCache(pImport, payload, rows);
|
||||||
} else {
|
} else {
|
||||||
dTrace("vid:%d sid:%d id:%s, data is already imported to cache", pObj->vnode, pObj->sid, pObj->meterId);
|
dTrace("vid:%d sid:%d id:%s, data is already imported to cache, firstKey:%lld", pObj->vnode, pObj->sid, pObj->meterId, pImport->firstKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
return code;
|
return code;
|
||||||
|
|
|
@ -517,3 +517,22 @@ FORCE_INLINE double taos_align_get_double(char* pBuf) {
|
||||||
*(int64_t*)(&dv) = *(int64_t*)pBuf;
|
*(int64_t*)(&dv) = *(int64_t*)pBuf;
|
||||||
return dv;
|
return dv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
typedef struct CharsetPair {
|
||||||
|
char *oldCharset;
|
||||||
|
char *newCharset;
|
||||||
|
} CharsetPair;
|
||||||
|
|
||||||
|
char *taosCharsetReplace(char *charsetstr) {
|
||||||
|
CharsetPair charsetRep[] = {
|
||||||
|
{ "utf8", "UTF-8" }, { "936", "CP936" },
|
||||||
|
};
|
||||||
|
|
||||||
|
for (int32_t i = 0; i < tListLen(charsetRep); ++i) {
|
||||||
|
if (strcasecmp(charsetRep[i].oldCharset, charsetstr) == 0) {
|
||||||
|
return strdup(charsetRep[i].newCharset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return strdup(charsetstr);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue