diff --git a/CMakeLists.txt b/CMakeLists.txt
index dcad242a303f4546e93e1e86e94c9d613c3b0de8..ff5da13254bb7714d12d8afe1e9dd63f8e85e17d 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,8 +38,9 @@ IF (NOT DEFINED TD_CLUSTER)
# Set macro definitions according to os platform
SET(TD_LINUX_64 FALSE)
SET(TD_LINUX_32 FALSE)
- SET(TD_ARM_64 FALSE)
- SET(TD_ARM_32 FALSE)
+ SET(_TD_ARM_ FALSE)
+ SET(_TD_ARM_64 FALSE)
+ SET(_TD_ARM_32 FALSE)
SET(TD_MIPS_64 FALSE)
SET(TD_DARWIN_64 FALSE)
SET(TD_WINDOWS_64 FALSE)
@@ -50,9 +51,18 @@ IF (NOT DEFINED TD_CLUSTER)
SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux)
ADD_DEFINITIONS(-D_M_X64)
MESSAGE(STATUS "The current platform is Linux 64-bit")
- ELSE ()
+ ELSEIF (${CMAKE_SIZEOF_VOID_P} MATCHES 4)
+ IF (_TD_ARM_)
SET(TD_LINUX_32 TRUE)
- MESSAGE(FATAL_ERROR "The current platform is Linux 32-bit, not supported yet")
+ SET(TD_OS_DIR ${TD_COMMUNITY_DIR}/src/os/linux)
+ #ADD_DEFINITIONS(-D_M_IX86)
+ MESSAGE(STATUS "The current platform is Linux 32-bit")
+ ELSE ()
+ MESSAGE(FATAL_ERROR "The current platform is Linux 32-bit, but no ARM not supported yet")
+ EXIT ()
+ ENDIF ()
+ ELSE ()
+ MESSAGE(FATAL_ERROR "The current platform is Linux neither 32-bit nor 64-bit, not supported yet")
EXIT ()
ENDIF ()
ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
@@ -102,13 +112,27 @@ IF (NOT DEFINED TD_CLUSTER)
IF (TD_LINUX_64)
SET(DEBUG_FLAGS "-O0 -DDEBUG")
SET(RELEASE_FLAGS "-O0")
- IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
- SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
+ IF (NOT _TD_ARM_)
+ IF (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+ SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
+ ELSE ()
+ SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
+ ENDIF ()
ELSE ()
- SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -malign-double -g -Wno-char-subscripts -malign-stringops -msse4.2 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
+ SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -Wno-char-subscripts -fsigned-char -munaligned-access -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
ENDIF ()
ADD_DEFINITIONS(-DLINUX)
ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
+ ELSEIF (TD_LINUX_32)
+ IF (NOT _TD_ARM_)
+ EXIT ()
+ ENDIF ()
+ SET(DEBUG_FLAGS "-O0 -DDEBUG")
+ SET(RELEASE_FLAGS "-O0")
+ SET(COMMON_FLAGS "-std=gnu99 -Wall -fPIC -g -Wno-char-subscripts -fsigned-char -munaligned-access -fpack-struct=8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE")
+ ADD_DEFINITIONS(-DLINUX)
+ ADD_DEFINITIONS(-D_REENTRANT -D__USE_POSIX -D_LIBC_REENTRANT)
+ ADD_DEFINITIONS(-DUSE_LIBICONV)
ELSEIF (TD_WINDOWS_64)
SET(CMAKE_GENERATOR "NMake Makefiles" CACHE INTERNAL "" FORCE)
SET(COMMON_FLAGS "/nologo /WX- /Oi /Oy- /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Gd /errorReport:prompt /analyze-")
@@ -169,6 +193,14 @@ IF (NOT DEFINED TD_CLUSTER)
INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})")
INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})")
+ ELSEIF (TD_LINUX_32)
+ IF (NOT _TD_ARM_)
+ EXIT ()
+ ENDIF ()
+ SET(TD_MAKE_INSTALL_SH "${TD_COMMUNITY_DIR}/packaging/tools/make_install.sh")
+ INSTALL(CODE "MESSAGE(\"make install script: ${TD_MAKE_INSTALL_SH}\")")
+ INSTALL(CODE "execute_process(COMMAND chmod 777 ${TD_MAKE_INSTALL_SH})")
+ INSTALL(CODE "execute_process(COMMAND ${TD_MAKE_INSTALL_SH} ${TD_COMMUNITY_DIR} ${PROJECT_BINARY_DIR})")
ELSEIF (TD_WINDOWS_64)
SET(CMAKE_INSTALL_PREFIX C:/TDengine)
INSTALL(DIRECTORY ${TD_COMMUNITY_DIR}/src/connector/go DESTINATION connector)
diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt
index 3bb2f748680103da37f04d35b515188bcee09ea3..de0312543828d9664049446ecb64fccdd97bfcf2 100644
--- a/src/client/CMakeLists.txt
+++ b/src/client/CMakeLists.txt
@@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
AUX_SOURCE_DIRECTORY(./src SRC)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/jni/linux)
# set the static lib name
diff --git a/src/client/src/TSDBJNIConnector.c b/src/client/src/TSDBJNIConnector.c
index fb175618c0429d08e86976c5dc7f20c91918f653..e98acfc9a68b2dfd108e047b580b115e72bcac42 100644
--- a/src/client/src/TSDBJNIConnector.c
+++ b/src/client/src/TSDBJNIConnector.c
@@ -13,8 +13,6 @@
* along with this program. If not, see .
*/
-#include
-
#include "os.h"
#include "com_taosdata_jdbc_TSDBJNIConnector.h"
#include "taos.h"
diff --git a/src/client/src/tscAst.c b/src/client/src/tscAst.c
index 845a9fd36d1a694d39e35f1ad3c0b06ec0f1b59c..fe0921c64d72af1d36202dfd57d8c93a33cc0b4d 100644
--- a/src/client/src/tscAst.c
+++ b/src/client/src/tscAst.c
@@ -13,12 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
-
#include "os.h"
#include "taosmsg.h"
#include "tast.h"
diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c
index 6e0e1ae7c5c73720a53558701b01fb79af592e27..aad02959591eab0b1ea48e0336ea4d0eed3774b6 100644
--- a/src/client/src/tscAsync.c
+++ b/src/client/src/tscAsync.c
@@ -13,8 +13,7 @@
* along with this program. If not, see .
*/
-#include
-#include
+#include "os.h"
#include "tlog.h"
#include "trpc.h"
diff --git a/src/client/src/tscCache.c b/src/client/src/tscCache.c
index 866b6e7dbc137c6e07d21d1e140ded39d1f4cd88..f508857ce1bc1477dc898de400b96c234ffe9bd8 100644
--- a/src/client/src/tscCache.c
+++ b/src/client/src/tscCache.c
@@ -13,14 +13,7 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
+#include "os.h"
#include "tglobalcfg.h"
#include "tlog.h"
diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c
index 0f9be904128c76f57746fe5eb3c043d58cf2c311..c23536f63170876bb4b3998fa38fafbc8c3cd23d 100644
--- a/src/client/src/tscFunctionImpl.c
+++ b/src/client/src/tscFunctionImpl.c
@@ -15,16 +15,6 @@
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
#include "os.h"
#include "taosmsg.h"
#include "tast.h"
@@ -3786,10 +3776,11 @@ static void getStatics_i64(int64_t *primaryKey, int64_t *data, int32_t numOfRow,
static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, double *min, double *max, double *sum,
int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull) {
- *min = DBL_MAX;
- *max = -DBL_MAX;
- *minIndex = 0;
- *maxIndex = 0;
+ float fmin = DBL_MAX;
+ float fmax = -DBL_MAX;
+ float fminIndex = 0;
+ float fmaxIndex = 0;
+ double dsum = 0;
assert(numOfRow <= INT16_MAX);
@@ -3799,15 +3790,19 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou
continue;
}
- *sum += data[i];
- if (*min > data[i]) {
- *min = data[i];
- *minIndex = i;
+ float fv = 0;
+ *(int32_t*)(&fv) = *(int32_t*)(&(data[i]));
+
+ //*sum += data[i];
+ dsum += fv;
+ if (fmin > fv) {
+ fmin = fv;
+ fminIndex = i;
}
- if (*max < data[i]) {
- *max = data[i];
- *maxIndex = i;
+ if (fmax < fv) {
+ fmax = fv;
+ fmaxIndex = i;
}
// if (isNull(&lastVal, TSDB_DATA_TYPE_FLOAT)) {
@@ -3819,14 +3814,26 @@ static void getStatics_f(int64_t *primaryKey, float *data, int32_t numOfRow, dou
// lastVal = data[i];
// }
}
+
+ double csum = 0;
+ *(int64_t*)(&csum) = *(int64_t*)sum;
+ csum += dsum;
+ *(int64_t*)(sum) = *(int64_t*)(&csum);
+
+ *(int32_t*)max = *(int32_t*)(&fmax);
+ *(int32_t*)min = *(int32_t*)(&fmin);
+ *(int32_t*)minIndex = *(int32_t*)(&fminIndex);
+ *(int32_t*)maxIndex = *(int32_t*)(&fmaxIndex);
+
}
static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, double *min, double *max, double *sum,
int16_t *minIndex, int16_t *maxIndex, int32_t *numOfNull) {
- *min = DBL_MAX;
- *max = -DBL_MAX;
- *minIndex = 0;
- *maxIndex = 0;
+ double dmin = DBL_MAX;
+ double dmax = -DBL_MAX;
+ double dminIndex = 0;
+ double dmaxIndex = 0;
+ double dsum = 0;
assert(numOfRow <= INT16_MAX);
@@ -3839,15 +3846,19 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do
continue;
}
- *sum += data[i];
- if (*min > data[i]) {
- *min = data[i];
- *minIndex = i;
+ double dv = 0;
+ *(int64_t*)(&dv) = *(int64_t*)(&(data[i]));
+
+ //*sum += data[i];
+ dsum += dv;
+ if (dmin > dv) {
+ dmin = dv;
+ dminIndex = i;
}
- if (*max < data[i]) {
- *max = data[i];
- *maxIndex = i;
+ if (dmax < dv) {
+ dmax = dv;
+ dmaxIndex = i;
}
// if (isNull(&lastVal, TSDB_DATA_TYPE_DOUBLE)) {
@@ -3859,6 +3870,16 @@ static void getStatics_d(int64_t *primaryKey, double *data, int32_t numOfRow, do
// lastVal = data[i];
// }
}
+
+ double csum = 0;
+ *(int64_t*)(&csum) = *(int64_t*)sum;
+ csum += dsum;
+ *(int64_t*)(sum) = *(int64_t*)(&csum);
+
+ *(int64_t*)max = *(int64_t*)(&dmax);
+ *(int64_t*)min = *(int64_t*)(&dmin);
+ *(int64_t*)minIndex = *(int64_t*)(&dminIndex);
+ *(int64_t*)maxIndex = *(int64_t*)(&dmaxIndex);
}
void getStatistics(char *priData, char *data, int32_t size, int32_t numOfRow, int32_t type, int64_t *min, int64_t *max,
diff --git a/src/client/src/tscJoinProcess.c b/src/client/src/tscJoinProcess.c
index 4965498eff0dbadbbf87d3e04d757e6afd002fa4..dfeebc8c61e868b9b7c558287b40ad0fbc093099 100644
--- a/src/client/src/tscJoinProcess.c
+++ b/src/client/src/tscJoinProcess.c
@@ -13,13 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
-#include
-
#include "os.h"
#include "tcache.h"
#include "tscJoinProcess.h"
diff --git a/src/client/src/tscLocal.c b/src/client/src/tscLocal.c
index 9afb74fec201353dc5980aa572a1a7af2fe4cae9..d217d0958833fad40c2a2aaf7cb135e43222f56c 100644
--- a/src/client/src/tscLocal.c
+++ b/src/client/src/tscLocal.c
@@ -13,9 +13,7 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
+#include "os.h"
#include "taosmsg.h"
#include "tcache.h"
diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c
index 37a32e9ebb360ed0a3bc1f9f97a5b70955782ec5..c8ce728de15858e2628bb6a8debd011197ecd184 100644
--- a/src/client/src/tscParseInsert.c
+++ b/src/client/src/tscParseInsert.c
@@ -21,22 +21,8 @@
#pragma GCC diagnostic ignored "-Woverflow"
#pragma GCC diagnostic ignored "-Wunused-variable"
-#include
-#include
-#include
-
-#include
-#include
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "ihash.h"
#include "os.h"
+#include "ihash.h"
#include "tscSecondaryMerge.h"
#include "tscUtil.h"
#include "tschemautil.h"
diff --git a/src/client/src/tscPrepare.c b/src/client/src/tscPrepare.c
index e956d6159e4a02707e15197672b59edc66466043..03f644ac36ddb985402a7a72ce68283abaafc63a 100644
--- a/src/client/src/tscPrepare.c
+++ b/src/client/src/tscPrepare.c
@@ -13,9 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-
#include "taos.h"
#include "tsclient.h"
#include "tsql.h"
diff --git a/src/client/src/tscProfile.c b/src/client/src/tscProfile.c
index b6de98e7128ab08c7318c9510acab9c8670d60ac..350167a3b35ba8e1dbf32c5b93bb6011e09adddf 100644
--- a/src/client/src/tscProfile.c
+++ b/src/client/src/tscProfile.c
@@ -13,9 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-
#include "os.h"
#include "tlog.h"
#include "tsclient.h"
@@ -96,7 +93,7 @@ void tscSaveSlowQuery(SSqlObj *pSql) {
const static int64_t SLOW_QUERY_INTERVAL = 3000000L;
if (pSql->res.useconds < SLOW_QUERY_INTERVAL) return;
- tscTrace("%p query time:%ld sql:%s", pSql, pSql->res.useconds, pSql->sqlstr);
+ tscTrace("%p query time:%lld sql:%s", pSql, pSql->res.useconds, pSql->sqlstr);
char *sql = malloc(200);
int len = snprintf(sql, 200, "insert into %s.slowquery values(now, '%s', %lld, %lld, '", tsMonitorDbName,
diff --git a/src/client/src/tscSQLParserImpl.c b/src/client/src/tscSQLParserImpl.c
index 7e1b4a7cf19e75274f65f10d8344c200c7ad8fb7..4fefe1665c514bce7215c395132c7b4290d433ce 100644
--- a/src/client/src/tscSQLParserImpl.c
+++ b/src/client/src/tscSQLParserImpl.c
@@ -13,13 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
-#include
-
#include "os.h"
#include "tglobalcfg.h"
#include "tsql.h"
diff --git a/src/client/src/tscSchemaUtil.c b/src/client/src/tscSchemaUtil.c
index 9728811ae70286264ed0ee6d91b144a1743a1120..5e50c27ab1af180009a4aa13a221073f33168a5f 100644
--- a/src/client/src/tscSchemaUtil.c
+++ b/src/client/src/tscSchemaUtil.c
@@ -13,10 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-
#include "os.h"
#include "taosmsg.h"
#include "tschemautil.h"
diff --git a/src/client/src/tscSecondaryMerge.c b/src/client/src/tscSecondaryMerge.c
index ac2638f635961bcdab3593994228164d79fdb6a0..398cd1cca6ceb4de0042788e78ab3336448019ed 100644
--- a/src/client/src/tscSecondaryMerge.c
+++ b/src/client/src/tscSecondaryMerge.c
@@ -13,13 +13,8 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
-#include "tlosertree.h"
+#include "os.h"
#include "tlosertree.h"
#include "tscSecondaryMerge.h"
#include "tscUtil.h"
diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c
index 6edec3d4773f94bd0c6de975653dfd56f6d4f8a8..49368e4d177b200e37af1f0572d24b1f3fba60f3 100644
--- a/src/client/src/tscServer.c
+++ b/src/client/src/tscServer.c
@@ -13,12 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
-
#include "os.h"
#include "tcache.h"
#include "trpc.h"
@@ -2848,7 +2842,7 @@ int tscBuildMetricMetaMsg(SSqlObj *pSql) {
return msgLen;
}
-int tscEstimateBuildHeartBeatMsgLength(SSqlObj *pSql) {
+int tscEstimateHeartBeatMsgLength(SSqlObj *pSql) {
int size = 0;
STscObj *pObj = pSql->pTscObj;
@@ -2881,7 +2875,7 @@ int tscBuildHeartBeatMsg(SSqlObj *pSql) {
pthread_mutex_lock(&pObj->mutex);
- size = tscEstimateBuildHeartBeatMsgLength(pSql);
+ size = tscEstimateHeartBeatMsgLength(pSql);
if (TSDB_CODE_SUCCESS != tscAllocPayload(pCmd, size)) {
tscError("%p failed to malloc for heartbeat msg", pSql);
return -1;
@@ -3613,7 +3607,7 @@ int tscRenewMeterMeta(SSqlObj *pSql, char *meterId) {
code = tscDoGetMeterMeta(pSql, meterId, 0); // todo ??
} else {
- tscTrace("%p metric query not update metric meta, numOfTags:%d, numOfCols:%d, uid:%d, addr:%p", pSql,
+ tscTrace("%p metric query not update metric meta, numOfTags:%d, numOfCols:%d, uid:%lld, addr:%p", pSql,
pMeterMetaInfo->pMeterMeta->numOfTags, pCmd->numOfCols, pMeterMetaInfo->pMeterMeta->uid,
pMeterMetaInfo->pMeterMeta);
}
diff --git a/src/client/src/tscSql.c b/src/client/src/tscSql.c
index fa72b18d164f8db92e6da9e2baf77621d61f9145..10eac0bb637356f22ca42553e11c6e68a5873cd5 100644
--- a/src/client/src/tscSql.c
+++ b/src/client/src/tscSql.c
@@ -13,9 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-
#include "os.h"
#include "tcache.h"
#include "tlog.h"
diff --git a/src/client/src/tscSub.c b/src/client/src/tscSub.c
index dee8f02118c0fd2ef22428d67393a801073c23c8..bcbcaba4c4a207c07763198db72357459630b977 100644
--- a/src/client/src/tscSub.c
+++ b/src/client/src/tscSub.c
@@ -13,7 +13,7 @@
* along with this program. If not, see .
*/
-#include
+#include "os.h"
#include "shash.h"
#include "taos.h"
diff --git a/src/client/src/tscSyntaxtreefunction.c b/src/client/src/tscSyntaxtreefunction.c
index 00781919e466c5049de84650eacd1d0badf58b72..bbd30c1fa942c7fd9132f24a4e03ca2e034fd30b 100644
--- a/src/client/src/tscSyntaxtreefunction.c
+++ b/src/client/src/tscSyntaxtreefunction.c
@@ -13,10 +13,7 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
+#include "os.h"
#include "tscSyntaxtreefunction.h"
#include "tsql.h"
diff --git a/src/client/src/tscSystem.c b/src/client/src/tscSystem.c
index 7ebd43cd19d2b6b1f94ec21651c0fa3c2578c84f..708ceee4054c2f22dd44d1cf5a5c72a419994eff 100644
--- a/src/client/src/tscSystem.c
+++ b/src/client/src/tscSystem.c
@@ -13,15 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
#include "os.h"
#include "taosmsg.h"
#include "tcache.h"
diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c
index ec5c9806129197929667bfa30f2e55ce1f7446d7..579365647718d177053e114029ff52661b369086 100644
--- a/src/client/src/tscUtil.c
+++ b/src/client/src/tscUtil.c
@@ -13,10 +13,6 @@
* along with this program. If not, see .
*/
-#include
-#include
-#include
-
#include "os.h"
#include "ihash.h"
#include "taosmsg.h"
diff --git a/src/inc/ttimer.h b/src/inc/ttimer.h
index ddfd3f1fdf2a6d5e6a46ad16a047ed209ebcce8b..5424881e267187fc897cf3e996197202d1eae8f9 100644
--- a/src/inc/ttimer.h
+++ b/src/inc/ttimer.h
@@ -41,7 +41,7 @@ extern int taosTmrThreads;
tprintf("TMR ", tmrDebugFlag, __VA_ARGS__); \
} } while(0)
-#define MAX_NUM_OF_TMRCTL 32
+#define MAX_NUM_OF_TMRCTL 512
#define MSECONDS_PER_TICK 5
void *taosTmrInit(int maxTmr, int resoultion, int longest, const char *label);
diff --git a/src/kit/shell/CMakeLists.txt b/src/kit/shell/CMakeLists.txt
index 20aa0c9d3117c44b451cc6607dd4518d637b621a..96dcec64c81f86cf9de43f0463e7868af25402fe 100644
--- a/src/kit/shell/CMakeLists.txt
+++ b/src/kit/shell/CMakeLists.txt
@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
AUX_SOURCE_DIRECTORY(./src SRC)
LIST(REMOVE_ITEM SRC ./src/shellWindows.c)
ADD_EXECUTABLE(shell ${SRC})
diff --git a/src/kit/taosdemo/CMakeLists.txt b/src/kit/taosdemo/CMakeLists.txt
index 38a28e3079790d21783ba3d4e44ababd0ff843c5..5384fce62dff48c7dfd23aa26c70b3c342021da8 100644
--- a/src/kit/taosdemo/CMakeLists.txt
+++ b/src/kit/taosdemo/CMakeLists.txt
@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdemo ${SRC})
TARGET_LINK_LIBRARIES(taosdemo taos_static)
diff --git a/src/kit/taosdump/CMakeLists.txt b/src/kit/taosdump/CMakeLists.txt
index 2bcc020654c603b4f43c862e452d90d937d7466a..49940add9a9f929607827c101995c812bb909d11 100644
--- a/src/kit/taosdump/CMakeLists.txt
+++ b/src/kit/taosdump/CMakeLists.txt
@@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
AUX_SOURCE_DIRECTORY(. SRC)
ADD_EXECUTABLE(taosdump ${SRC})
TARGET_LINK_LIBRARIES(taosdump taos_static)
diff --git a/src/modules/http/CMakeLists.txt b/src/modules/http/CMakeLists.txt
index 911c5a3515852907e58d6811dc2b34ba73ed0d87..4805271d661ed8c6d81702852a0fc949904aa25b 100644
--- a/src/modules/http/CMakeLists.txt
+++ b/src/modules/http/CMakeLists.txt
@@ -1,7 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/zlib-1.2.11/inc)
diff --git a/src/modules/monitor/CMakeLists.txt b/src/modules/monitor/CMakeLists.txt
index ff8ddb1c2daac76823c98ea6c8044655fb34e66b..baa5e6218c8996d8dc400c03753d0fe6c5a2f2a7 100644
--- a/src/modules/monitor/CMakeLists.txt
+++ b/src/modules/monitor/CMakeLists.txt
@@ -1,7 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
diff --git a/src/os/linux/CMakeLists.txt b/src/os/linux/CMakeLists.txt
index 8a4cc56f72211953f11512981c99dc7076a0c0c5..14e7e06b236edd0b4f34d1c5d93fec9dc888f025 100644
--- a/src/os/linux/CMakeLists.txt
+++ b/src/os/linux/CMakeLists.txt
@@ -1,7 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(inc)
AUX_SOURCE_DIRECTORY(src SRC)
diff --git a/src/os/linux/inc/os.h b/src/os/linux/inc/os.h
index 78065e6df0590755d098563316fbe214c695658d..ee65965a5b44420f12ee6c053879908282999a09 100644
--- a/src/os/linux/inc/os.h
+++ b/src/os/linux/inc/os.h
@@ -1,17 +1,17 @@
/*
-* Copyright (c) 2019 TAOS Data, Inc.
-*
-* This program is free software: you can use, redistribute, and/or modify
-* it under the terms of the GNU Affero General Public License, version 3
-* or later ("AGPL"), as published by the Free Software Foundation.
-*
-* This program is distributed in the hope that it will be useful, but WITHOUT
-* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-* FITNESS FOR A PARTICULAR PURPOSE.
-*
-* You should have received a copy of the GNU Affero General Public License
-* along with this program. If not, see .
-*/
+ * Copyright (c) 2019 TAOS Data, Inc.
+ *
+ * This program is free software: you can use, redistribute, and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3
+ * or later ("AGPL"), as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+ */
#ifndef TDENGINE_PLATFORM_LINUX_H
#define TDENGINE_PLATFORM_LINUX_H
@@ -25,10 +25,12 @@ extern "C" {
#include
#include
+#include
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -37,7 +39,8 @@ extern "C" {
#include
#include
#include
-#include
+#include
+#include
#include
#include
#include
@@ -45,21 +48,19 @@ extern "C" {
#include
#include
#include
+#include
#include
#include
#include
#include
#include
#include
-#include
#include
#include
#include
#include
#include
#include
-#include
-#include
#define taosCloseSocket(x) \
{ \
@@ -110,7 +111,7 @@ extern "C" {
#define __sync_sub_and_fetch_ptr __sync_sub_and_fetch
int32_t __sync_val_load_32(int32_t *ptr);
-void __sync_val_restore_32(int32_t *ptr, int32_t newval);
+void __sync_val_restore_32(int32_t *ptr, int32_t newval);
#define SWAP(a, b, c) \
do { \
@@ -168,9 +169,9 @@ bool taosSkipSocketCheck();
int64_t str2int64(char *str);
#define BUILDIN_CLZL(val) __builtin_clzl(val)
-#define BUILDIN_CLZ(val) __builtin_clz(val)
+#define BUILDIN_CLZ(val) __builtin_clz(val)
#define BUILDIN_CTZL(val) __builtin_ctzl(val)
-#define BUILDIN_CTZ(val) __builtin_ctz(val)
+#define BUILDIN_CTZ(val) __builtin_ctz(val)
#ifdef __cplusplus
}
diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt
index b3a761e3dffdf01e24f9e22369a940cfadd80e2a..febb3eb83f6b4f1333e484efcbd6041065ca5876 100644
--- a/src/rpc/CMakeLists.txt
+++ b/src/rpc/CMakeLists.txt
@@ -5,7 +5,7 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
AUX_SOURCE_DIRECTORY(./src SRC)
ELSEIF (TD_DARWIN_64)
LIST(APPEND SRC ./src/thaship.c)
diff --git a/src/sdb/CMakeLists.txt b/src/sdb/CMakeLists.txt
index 76b407fdedc06f0463baa6b6261c3e6bf4c7d29e..08cdb4baef114743a0ec679491bf17bcdbfdb6b8 100644
--- a/src/sdb/CMakeLists.txt
+++ b/src/sdb/CMakeLists.txt
@@ -5,11 +5,11 @@ INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
INCLUDE_DIRECTORIES(inc)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(sdb ${SRC})
TARGET_LINK_LIBRARIES(sdb trpc)
IF (TD_CLUSTER)
TARGET_LINK_LIBRARIES(sdb sdb_cluster)
ENDIF ()
-ENDIF ()
\ No newline at end of file
+ENDIF ()
diff --git a/src/system/detail/CMakeLists.txt b/src/system/detail/CMakeLists.txt
index 9233d6c71bddda7238b3fd351b59293ab957a546..16468e7984416018315d1181b0435bf40a604173 100644
--- a/src/system/detail/CMakeLists.txt
+++ b/src/system/detail/CMakeLists.txt
@@ -1,7 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc)
diff --git a/src/system/detail/src/mgmtMeter.c b/src/system/detail/src/mgmtMeter.c
index bccf9a06c8652cecf6e0ef9b884479523358c614..2692e39131256ac718e3b4435457fba1c84b1c11 100644
--- a/src/system/detail/src/mgmtMeter.c
+++ b/src/system/detail/src/mgmtMeter.c
@@ -833,6 +833,7 @@ static void removeMeterFromMetricIndex(STabObj *pMetric, STabObj *pMeter) {
}
}
+ tSkipListDestroyKey(&key);
if (num != 0) {
free(pRes);
}
diff --git a/src/system/detail/src/vnodeQueryImpl.c b/src/system/detail/src/vnodeQueryImpl.c
index 187269d30b1b374778dc5646677a2d275a3bce27..9c0d7883a5242987b46909b98f7d0081ba82fc92 100644
--- a/src/system/detail/src/vnodeQueryImpl.c
+++ b/src/system/detail/src/vnodeQueryImpl.c
@@ -3436,9 +3436,18 @@ void pointInterpSupporterSetData(SQInfo *pQInfo, SPointInterpoSupporter *pPointI
if (pQuery->interpoType == TSDB_INTERPO_SET_VALUE) {
for (int32_t i = 0; i < pQuery->numOfOutputCols; ++i) {
SQLFunctionCtx *pCtx = &pRuntimeEnv->pCtx[i];
+
+ // only the function of interp needs the corresponding information
+ if (pCtx->functionId != TSDB_FUNC_INTERP) {
+ continue;
+ }
+
+ pCtx->numOfParams = 4;
+
SInterpInfo * pInterpInfo = (SInterpInfo *)pRuntimeEnv->pCtx[i].aOutputBuf;
pInterpInfo->pInterpDetail = calloc(1, sizeof(SInterpInfoDetail));
+
SInterpInfoDetail *pInterpDetail = pInterpInfo->pInterpDetail;
// for primary timestamp column, set the flag
diff --git a/src/system/detail/src/vnodeRead.c b/src/system/detail/src/vnodeRead.c
index 3e580b747f72280323ebbe85092d1227d82d9b40..f35567e7200ec578ac59d91385076da78eefe426 100644
--- a/src/system/detail/src/vnodeRead.c
+++ b/src/system/detail/src/vnodeRead.c
@@ -866,7 +866,8 @@ int vnodeSaveQueryResult(void *handle, char *data, int32_t *size) {
pQInfo->pointsRead);
if (pQInfo->over == 0) {
- dTrace("QInfo:%p set query flag, oldSig:%p, func:%s", pQInfo, pQInfo->signature, __FUNCTION__);
+ //dTrace("QInfo:%p set query flag, oldSig:%p, func:%s", pQInfo, pQInfo->signature, __FUNCTION__);
+ dTrace("QInfo:%p set query flag, oldSig:%p", pQInfo, pQInfo->signature);
uint64_t oldSignature = TSDB_QINFO_SET_QUERY_FLAG(pQInfo);
/*
diff --git a/src/system/detail/src/vnodeShell.c b/src/system/detail/src/vnodeShell.c
index 190c1d6ee675ae11e15adecd080bbd20c765e2e9..353b2668ee94c1da31b005f84beb63e5036b6341 100644
--- a/src/system/detail/src/vnodeShell.c
+++ b/src/system/detail/src/vnodeShell.c
@@ -419,7 +419,7 @@ void vnodeExecuteRetrieveReq(SSchedMsg *pSched) {
if (code == TSDB_CODE_SUCCESS) {
pRsp->offset = htobe64(vnodeGetOffsetVal(pRetrieve->qhandle));
- pRsp->useconds = ((SQInfo *)(pRetrieve->qhandle))->useconds;
+ pRsp->useconds = htobe64(((SQInfo *)(pRetrieve->qhandle))->useconds);
} else {
pRsp->offset = 0;
pRsp->useconds = 0;
diff --git a/src/system/lite/CMakeLists.txt b/src/system/lite/CMakeLists.txt
index 965f7666b056dbf21ffcd259c922503f24665666..e9257b23888f436ba7b2891eaa238741152f1330 100644
--- a/src/system/lite/CMakeLists.txt
+++ b/src/system/lite/CMakeLists.txt
@@ -1,7 +1,7 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(TDengine)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/client/inc)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/modules/http/inc)
diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt
index 7e54759f7e20dffa7c6250af446144d6fcf89c17..b36ae3a4b5425e66bb641dcaee885a5554ca3a50 100644
--- a/src/util/CMakeLists.txt
+++ b/src/util/CMakeLists.txt
@@ -4,7 +4,7 @@ PROJECT(TDengine)
INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc)
INCLUDE_DIRECTORIES(${TD_OS_DIR}/inc)
-IF (TD_LINUX_64)
+IF ((TD_LINUX_64) OR (TD_LINUX_32 AND _TD_ARM_))
AUX_SOURCE_DIRECTORY(src SRC)
ADD_LIBRARY(tutil ${SRC})
TARGET_LINK_LIBRARIES(tutil pthread os m rt)
diff --git a/src/util/src/version.c b/src/util/src/version.c
index dc2c3c5480e871961cb350d06acf2da51d6006cc..96e7ad4eadd0557795ef44edaae07c3c568308f0 100644
--- a/src/util/src/version.c
+++ b/src/util/src/version.c
@@ -1,4 +1,4 @@
char version[64] = "1.6.4.0";
char compatible_version[64] = "1.6.1.0";
-char gitinfo[128] = "869171d2331eb25ba0901e88d33ae627bf5a9d91";
-char buildinfo[512] = "Built by ubuntu at 2019-11-07 22:31";
+char gitinfo[128] = "d04354a8ac2f7dd9ba521d755e5d484a203783d9";
+char buildinfo[512] = "Built by root at 2019-11-11 10:23";