diff --git a/include/common/tglobal.h b/include/common/tglobal.h index 657435e5ff..d6c552b3f6 100644 --- a/include/common/tglobal.h +++ b/include/common/tglobal.h @@ -34,6 +34,7 @@ extern char tsFirst[]; extern char tsSecond[]; extern char tsLocalFqdn[]; extern char tsLocalEp[]; +extern char tsVersionName[]; extern uint16_t tsServerPort; extern int32_t tsVersion; extern int32_t tsStatusInterval; diff --git a/source/common/CMakeLists.txt b/source/common/CMakeLists.txt index 9c6d941172..356ea2be1c 100644 --- a/source/common/CMakeLists.txt +++ b/source/common/CMakeLists.txt @@ -1,4 +1,8 @@ aux_source_directory(src COMMON_SRC) +IF (TD_ENTERPRISE) +LIST(APPEND COMMON_SRC ${TD_ENTERPRISE_DIR}/src/plugins/common/src/tglobal.c) +ENDIF() + add_library(common STATIC ${COMMON_SRC}) if (DEFINED GRANT_CFG_INCLUDE_DIR) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 3545ece6d8..ec528f5827 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -34,6 +34,7 @@ char tsFirst[TSDB_EP_LEN] = {0}; char tsSecond[TSDB_EP_LEN] = {0}; char tsLocalFqdn[TSDB_FQDN_LEN] = {0}; char tsLocalEp[TSDB_EP_LEN] = {0}; // Local End Point, hostname:port +char tsVersionName[16] = "community"; uint16_t tsServerPort = 6030; int32_t tsVersion = 30000000; int32_t tsStatusInterval = 1; // second @@ -938,6 +939,12 @@ static int32_t taosSetServerCfg(SConfig *pCfg) { return 0; } +#ifndef TD_ENTERPRISE +static int32_t taosSetReleaseCfg(SConfig *pCfg) { return 0; } +#else +int32_t taosSetReleaseCfg(SConfig *pCfg); +#endif + void taosLocalCfgForbiddenToChange(char *name, bool *forbidden) { int32_t len = strlen(name); char lowcaseName[CFG_NAME_MAX_LEN + 1] = {0}; @@ -1444,6 +1451,7 @@ int32_t taosInitCfg(const char *cfgDir, const char **envCmd, const char *envFile if (taosSetClientCfg(tsCfg)) return -1; if (taosUpdateServerCfg(tsCfg)) return -1; if (taosSetServerCfg(tsCfg)) return -1; + if (taosSetReleaseCfg(tsCfg)) return -1; if (taosSetTfsCfg(tsCfg) != 0) return -1; } taosSetSystemCfg(tsCfg); diff --git a/source/dnode/mgmt/node_mgmt/src/dmEnv.c b/source/dnode/mgmt/node_mgmt/src/dmEnv.c index caabd14143..848e123448 100644 --- a/source/dnode/mgmt/node_mgmt/src/dmEnv.c +++ b/source/dnode/mgmt/node_mgmt/src/dmEnv.c @@ -40,7 +40,6 @@ goto _exit; \ } while (0) -extern char tsVersionName[16]; static SDnode globalDnode = {0}; static const char *dmOS[10] = {"Ubuntu", "CentOS Linux", "Red Hat", "Debian GNU", "CoreOS", "FreeBSD", "openSUSE", "SLES", "Fedora", "MacOS"}; @@ -72,7 +71,6 @@ static int32_t dmInitMonitor() { DM_INIT_MON(); - dInfo("%s:%d stName is %s", __func__, __LINE__, stName); if (STR_STR_CMP(stName, STR_STR_SIGN)) { DM_ERR_RTN(0); } diff --git a/source/dnode/mnode/impl/src/mndCluster.c b/source/dnode/mnode/impl/src/mndCluster.c index 4d05637a2b..8ea98242f9 100644 --- a/source/dnode/mnode/impl/src/mndCluster.c +++ b/source/dnode/mnode/impl/src/mndCluster.c @@ -20,7 +20,6 @@ #define CLUSTER_VER_NUMBE 1 #define CLUSTER_RESERVE_SIZE 60 -char tsVersionName[16] = "community"; int64_t tsExpireTime = 0; static SSdbRaw *mndClusterActionEncode(SClusterObj *pCluster);