Merge pull request #727 from taosdata/release/v1.6.3.1

Release/v1.6.3.1
This commit is contained in:
plum-lihui 2019-11-15 19:08:33 +08:00 committed by GitHub
commit ea6ded66fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 35 deletions

View File

@ -138,16 +138,23 @@ TAOS *taos_connect(char *ip, char *user, char *pass, char *db, int port) {
if (taos != NULL) { if (taos != NULL) {
STscObj* pObj = (STscObj*) taos; STscObj* pObj = (STscObj*) taos;
// version compare only requires the first 3 segments of the version string
int32_t comparedSegments = 3;
char client_version[64] = {0};
char server_version[64] = {0};
int clientVersionNumber[4] = {0}; int clientVersionNumber[4] = {0};
if (!taosGetVersionNumber(version, clientVersionNumber)) { int serverVersionNumber[4] = {0};
tscError("taos:%p, invalid client version:%s", taos, version);
strcpy(client_version, version);
strcpy(server_version, taos_get_server_info(taos));
if (!taosGetVersionNumber(client_version, clientVersionNumber)) {
tscError("taos:%p, invalid client version:%s", taos, client_version);
pObj->pSql->res.code = TSDB_CODE_INVALID_CLIENT_VERSION; pObj->pSql->res.code = TSDB_CODE_INVALID_CLIENT_VERSION;
taos_close(taos); taos_close(taos);
return NULL; return NULL;
} }
char *server_version = taos_get_server_info(taos);
int serverVersionNumber[4] = {0};
if (!taosGetVersionNumber(server_version, serverVersionNumber)) { if (!taosGetVersionNumber(server_version, serverVersionNumber)) {
tscError("taos:%p, invalid server version:%s", taos, server_version); tscError("taos:%p, invalid server version:%s", taos, server_version);
pObj->pSql->res.code = TSDB_CODE_INVALID_CLIENT_VERSION; pObj->pSql->res.code = TSDB_CODE_INVALID_CLIENT_VERSION;
@ -155,9 +162,6 @@ TAOS *taos_connect(char *ip, char *user, char *pass, char *db, int port) {
return NULL; return NULL;
} }
// version compare only requires the first 3 segments of the version string
int32_t comparedSegments = 3;
for(int32_t i = 0; i < comparedSegments; ++i) { for(int32_t i = 0; i < comparedSegments; ++i) {
if (clientVersionNumber[i] != serverVersionNumber[i]) { if (clientVersionNumber[i] != serverVersionNumber[i]) {
tscError("taos:%p, the %d-th number of server version:%s not matched with client version:%s, close connection", tscError("taos:%p, the %d-th number of server version:%s not matched with client version:%s, close connection",

View File

@ -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");

View File

@ -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)

View File

@ -96,10 +96,6 @@ void __sync_val_restore_32(int32_t *ptr, int32_t newval) {
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");

View File

@ -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;

View File

@ -508,3 +508,22 @@ char *taosIpStr(int ipInt) {
sprintf(ipStr, "0x%x:%d.%d.%d.%d", ipInt, ipInt & 0xFF, (ipInt >> 8) & 0xFF, (ipInt >> 16) & 0xFF, ipInt >> 24); sprintf(ipStr, "0x%x:%d.%d.%d.%d", ipInt, ipInt & 0xFF, (ipInt >> 8) & 0xFF, (ipInt >> 16) & 0xFF, ipInt >> 24);
return ipStr; return ipStr;
} }
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);
}