diff --git a/src/common/inc/tglobal.h b/src/common/inc/tglobal.h index bf1f22a4ee686b6b20815283c43d8c47ca933da2..e971a9c9574716d4ce879f78306d669c84013baa 100644 --- a/src/common/inc/tglobal.h +++ b/src/common/inc/tglobal.h @@ -161,7 +161,7 @@ extern float tsMinimalLogDirGB; extern float tsReservedTmpDirectorySpace; extern float tsMinimalDataDirGB; extern int32_t tsTotalMemoryMB; -extern int32_t tsVersion; +extern uint32_t tsVersion; // build info extern char version[]; diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index f007a82f8451e536fe991036fab8387e122bfaaf..cab234c7873f58468357ec7c30d02d0b7a80b9d1 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -201,7 +201,7 @@ float tsAvailDataDirGB = 0; float tsReservedTmpDirectorySpace = 0.1f; float tsMinimalDataDirGB = 0.5f; int32_t tsTotalMemoryMB = 0; -int32_t tsVersion = 0; +uint32_t tsVersion = 0; // log int32_t tsNumOfLogLines = 10000000; @@ -1451,15 +1451,20 @@ int32_t taosCheckGlobalCfg() { // todo refactor tsVersion = 0; - for (int i = 0; i < 10; i++) { + for (int ver = 0, i = 0; i < TSDB_VERSION_LEN; ++i) { if (version[i] >= '0' && version[i] <= '9') { - tsVersion = tsVersion * 10 + (version[i] - '0'); + ver = ver * 10 + (version[i] - '0'); + } else if (version[i] == '.') { + tsVersion |= ver & 0xFF; + tsVersion <<= 8; + + ver = 0; } else if (version[i] == 0) { + tsVersion |= ver & 0xFF; + break; } } - - tsVersion = 10 * tsVersion; tsDnodeShellPort = tsServerPort + TSDB_PORT_DNODESHELL; // udp[6035-6039] tcp[6035] tsDnodeDnodePort = tsServerPort + TSDB_PORT_DNODEDNODE; // udp/tcp diff --git a/src/util/inc/buildInfo.h b/src/util/inc/buildInfo.h deleted file mode 100644 index 8d169d618d51a1e0a4191c8c8fbe370536970478..0000000000000000000000000000000000000000 --- a/src/util/inc/buildInfo.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _TS_BUILD_H_ -#define _TS_BUILD_H_ - -extern const char tsVersion[]; -extern const char tsBuildInfo[]; - -#endif