From 87bfb683e973569d6278c9170ae41d9cb9a548d0 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 21 Feb 2022 17:53:40 +0800 Subject: [PATCH] [TS-1220]: add TSZ to default build --- .gitmodules | 1 + cmake/input.inc | 11 ++++++----- deps/CMakeLists.txt | 2 +- deps/TSZ | 1 + src/common/src/tglobal.c | 5 +++-- src/kit/taospack/taospack.c | 2 +- src/util/inc/tconfig.h | 2 +- 7 files changed, 14 insertions(+), 10 deletions(-) create mode 160000 deps/TSZ diff --git a/.gitmodules b/.gitmodules index 9efd31c948..bdaa5508b2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,7 @@ [submodule "deps/TSZ"] path = deps/TSZ url = https://github.com/taosdata/TSZ.git + branch = master [submodule "src/kit/taos-tools"] path = src/kit/taos-tools url = https://github.com/taosdata/taos-tools diff --git a/cmake/input.inc b/cmake/input.inc index bc79de48a4..9d411e382b 100755 --- a/cmake/input.inc +++ b/cmake/input.inc @@ -96,11 +96,12 @@ IF (${VERBOSE} MATCHES "true") SET(TD_BUILD_VERBOSE TRUE) ENDIF () -IF (${TSZ_ENABLED} MATCHES "true") - # define add +# build TSZ by default +IF ("${TSZ_ENABLED}" MATCHES "false") + set(VAR_TSZ "" CACHE INTERNAL "global variant empty" ) +ELSE() + # define add MESSAGE(STATUS "build with TSZ enabled") ADD_DEFINITIONS(-DTD_TSZ) set(VAR_TSZ "TSZ" CACHE INTERNAL "global variant tsz" ) -ELSE() - set(VAR_TSZ "" CACHE INTERNAL "global variant empty" ) -ENDIF() +ENDIF() \ No newline at end of file diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index a8b4fd288e..d4526a8839 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -45,6 +45,6 @@ IF (TD_LINUX_64 AND JEMALLOC_ENABLED) INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}/build/include) ENDIF () -IF (${TSZ_ENABLED} MATCHES "true") +IF (NOT "${TSZ_ENABLED}" MATCHES "false") ADD_SUBDIRECTORY(TSZ) ENDIF() diff --git a/deps/TSZ b/deps/TSZ new file mode 160000 index 0000000000..11c1060d4f --- /dev/null +++ b/deps/TSZ @@ -0,0 +1 @@ +Subproject commit 11c1060d4f917dd799ae628b131db5d6a5ef6954 diff --git a/src/common/src/tglobal.c b/src/common/src/tglobal.c index ab4f5fa4f4..a63fb76529 100644 --- a/src/common/src/tglobal.c +++ b/src/common/src/tglobal.c @@ -1800,9 +1800,10 @@ static void doInitGlobalConfig(void) { cfg.ptrLength = 0; cfg.unitType = TAOS_CFG_UTYPE_NONE; taosInitConfigOption(cfg); - assert(tsGlobalConfigNum < TSDB_CFG_MAX_NUM); + assert(tsGlobalConfigNum == TSDB_CFG_MAX_NUM); #else - assert(tsGlobalConfigNum < TSDB_CFG_MAX_NUM); + // if TD_TSZ macro define, have 5 count configs, so must add 5 + assert(tsGlobalConfigNum + 5 == TSDB_CFG_MAX_NUM); #endif } diff --git a/src/kit/taospack/taospack.c b/src/kit/taospack/taospack.c index 9e7355b42a..13360606df 100644 --- a/src/kit/taospack/taospack.c +++ b/src/kit/taospack/taospack.c @@ -704,7 +704,7 @@ void leakFloat() { void leakTest(){ - for(int i=0; i< 90000000000000; i++){ + for(int i=0; i< 90000000; i++){ if(i%10000==0) printf(" ---------- %d ---------------- \n", i); leakFloat(); diff --git a/src/util/inc/tconfig.h b/src/util/inc/tconfig.h index fd9a340a25..c0a4986936 100644 --- a/src/util/inc/tconfig.h +++ b/src/util/inc/tconfig.h @@ -20,7 +20,7 @@ extern "C" { #endif -#define TSDB_CFG_MAX_NUM 131 +#define TSDB_CFG_MAX_NUM 133 #define TSDB_CFG_PRINT_LEN 23 #define TSDB_CFG_OPTION_LEN 24 #define TSDB_CFG_VALUE_LEN 41 -- GitLab