From d54a114f70a1f6bbd3c367041c29630f047a5f80 Mon Sep 17 00:00:00 2001 From: huili Date: Wed, 5 Feb 2020 19:47:54 +0800 Subject: [PATCH 1/9] [release v1.6.5.4] --- src/util/src/version.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/src/version.c b/src/util/src/version.c index b8b0d611de..d1294801ee 100644 --- a/src/util/src/version.c +++ b/src/util/src/version.c @@ -1,7 +1,7 @@ -char version[64] = "1.6.5.3"; +char version[64] = "1.6.5.4"; char compatible_version[64] = "1.6.1.0"; -char gitinfo[128] = "700305490a82228ec1b0244afb838bdbb9de9793"; -char gitinfoOfInternal[128] = ""; -char buildinfo[512] = "Built by at 2020-01-17 13:22"; +char gitinfo[128] = "3264067e97300c84caa61ac909d548c9ca56de6b"; +char gitinfoOfInternal[128] = "da88f4a2474737d1f9c76adcf0ff7fd0975e7342"; +char buildinfo[512] = "Built by root at 2020-02-05 14:38"; -void libtaos_edge_1_6_5_1_Linux_x64() {}; +void libtaos_1_6_5_4_Linux_x64() {}; From 842bdc50c67f64fa76fe4c6cad389a2630768aee Mon Sep 17 00:00:00 2001 From: lihui Date: Sun, 9 Feb 2020 12:07:59 +0800 Subject: [PATCH 2/9] [modify pkg name] --- packaging/deb/makedeb.sh | 2 +- packaging/rpm/makerpm.sh | 2 +- packaging/tools/makeclient.sh | 2 +- packaging/tools/makepkg.sh | 4 ++-- src/util/src/ttime.c | 39 ++++++++++++++++++++++++++++++++++- 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/packaging/deb/makedeb.sh b/packaging/deb/makedeb.sh index 92734cb980..faa29aeac8 100755 --- a/packaging/deb/makedeb.sh +++ b/packaging/deb/makedeb.sh @@ -73,7 +73,7 @@ sed -i "2c$debver" ${pkg_dir}/DEBIAN/control if [ "$verMode" == "cluster" ]; then debname="TDengine-server-"${tdengine_ver}-${osType}-${cpuType} elif [ "$verMode" == "lite" ]; then - debname="TDengine-server-edge"-${tdengine_ver}-${osType}-${cpuType} + debname="TDengine-server"-${tdengine_ver}-${osType}-${cpuType} else echo "unknow verMode, nor cluster or lite" exit 1 diff --git a/packaging/rpm/makerpm.sh b/packaging/rpm/makerpm.sh index 20b7d5f755..cc31a6b8d4 100755 --- a/packaging/rpm/makerpm.sh +++ b/packaging/rpm/makerpm.sh @@ -66,7 +66,7 @@ cp_rpm_package ${pkg_dir}/RPMS if [ "$verMode" == "cluster" ]; then rpmname="TDengine-server-"${tdengine_ver}-${osType}-${cpuType} elif [ "$verMode" == "lite" ]; then - rpmname="TDengine-server-edge"-${tdengine_ver}-${osType}-${cpuType} + rpmname="TDengine-server"-${tdengine_ver}-${osType}-${cpuType} else echo "unknow verMode, nor cluster or lite" exit 1 diff --git a/packaging/tools/makeclient.sh b/packaging/tools/makeclient.sh index 34dacbc9f3..58ce6183c1 100755 --- a/packaging/tools/makeclient.sh +++ b/packaging/tools/makeclient.sh @@ -111,7 +111,7 @@ cd ${release_dir} if [ "$verMode" == "cluster" ]; then pkg_name=${install_dir}-${version}-${osType}-${cpuType} elif [ "$verMode" == "lite" ]; then - pkg_name=${install_dir}-edge-${version}-${osType}-${cpuType} + pkg_name=${install_dir}-${version}-${osType}-${cpuType} else echo "unknow verMode, nor cluster or lite" exit 1 diff --git a/packaging/tools/makepkg.sh b/packaging/tools/makepkg.sh index e0cd65a00e..1b095a4c76 100755 --- a/packaging/tools/makepkg.sh +++ b/packaging/tools/makepkg.sh @@ -111,7 +111,7 @@ cd ${release_dir} if [ "$verMode" == "cluster" ]; then pkg_name=${install_dir}-${version}-${osType}-${cpuType} elif [ "$verMode" == "lite" ]; then - pkg_name=${install_dir}-edge-${version}-${osType}-${cpuType} + pkg_name=${install_dir}-${version}-${osType}-${cpuType} else echo "unknow verMode, nor cluster or lite" exit 1 @@ -128,4 +128,4 @@ fi tar -zcv -f "$(basename ${pkg_name}).tar.gz" $(basename ${install_dir}) --remove-files || : -cd ${curr_dir} \ No newline at end of file +cd ${curr_dir} diff --git a/src/util/src/ttime.c b/src/util/src/ttime.c index 52faa0cac4..1408d1678f 100644 --- a/src/util/src/ttime.c +++ b/src/util/src/ttime.c @@ -24,7 +24,43 @@ #include "ttime.h" #include "tutil.h" +/* + * mktime64 - Converts date to seconds. + * Converts Gregorian date to seconds since 1970-01-01 00:00:00. + * Assumes input in normal date format, i.e. 1980-12-31 23:59:59 + * => year=1980, mon=12, day=31, hour=23, min=59, sec=59. + * + * [For the Julian calendar (which was used in Russia before 1917, + * Britain & colonies before 1752, anywhere else before 1582, + * and is still in use by some communities) leave out the + * -year/100+year/400 terms, and add 10.] + * + * This algorithm was first published by Gauss (I think). + * + * A leap second can be indicated by calling this function with sec as + * 60 (allowable under ISO 8601). The leap second is treated the same + * as the following second since they don't exist in UNIX time. + * + * An encoding of midnight at the end of the day as 24:00:00 - ie. midnight + * tomorrow - (allowable under ISO 8601) is supported. + */ +int64_t mktime64(const unsigned int year0, const unsigned int mon0, + const unsigned int day, const unsigned int hour, + const unsigned int min, const unsigned int sec) +{ + unsigned int mon = mon0, year = year0; + /* 1..12 -> 11,12,1..10 */ + if (0 >= (int) (mon -= 2)) { + mon += 12; /* Puts Feb last since it has leap day */ + year -= 1; + } + + int64_t res = (((((int64_t) (year/4 - year/100 + year/400 + 367*mon/12 + day) + + year*365 - 719499)*24 + hour)*60 + min)*60 + sec); + + return (res + timezone); +} // ==== mktime() kernel code =================// static int64_t m_deltaUtc = 0; void deltaToUtcInitOnce() { @@ -293,7 +329,8 @@ int32_t parseLocaltime(char* timestr, int64_t* time, int32_t timePrec) { /* mktime will be affected by TZ, set by using taos_options */ //int64_t seconds = mktime(&tm); - int64_t seconds = (int64_t)user_mktime(&tm); + //int64_t seconds = (int64_t)user_mktime(&tm); + int64_t seconds = mktime64(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); int64_t fraction = 0; From 69bbb5fcbb4a7a568a8a3538ee57f1d1715c5ec0 Mon Sep 17 00:00:00 2001 From: lihui Date: Sun, 9 Feb 2020 12:19:03 +0800 Subject: [PATCH 3/9] [#1199] --- src/util/src/ttime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/src/ttime.c b/src/util/src/ttime.c index 1408d1678f..65c5d0ea4c 100644 --- a/src/util/src/ttime.c +++ b/src/util/src/ttime.c @@ -44,7 +44,7 @@ * An encoding of midnight at the end of the day as 24:00:00 - ie. midnight * tomorrow - (allowable under ISO 8601) is supported. */ -int64_t mktime64(const unsigned int year0, const unsigned int mon0, +int64_t user_mktime64(const unsigned int year0, const unsigned int mon0, const unsigned int day, const unsigned int hour, const unsigned int min, const unsigned int sec) { @@ -330,7 +330,7 @@ int32_t parseLocaltime(char* timestr, int64_t* time, int32_t timePrec) { /* mktime will be affected by TZ, set by using taos_options */ //int64_t seconds = mktime(&tm); //int64_t seconds = (int64_t)user_mktime(&tm); - int64_t seconds = mktime64(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); + int64_t seconds = user_mktime64(tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec); int64_t fraction = 0; From f9f349551a241c4ced11411a7c13390c9c3b0e44 Mon Sep 17 00:00:00 2001 From: huili Date: Sun, 9 Feb 2020 16:43:40 +0800 Subject: [PATCH 4/9] [#1201] --- src/util/src/ttypes.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/src/ttypes.c b/src/util/src/ttypes.c index b4480f41cb..80e816ad11 100644 --- a/src/util/src/ttypes.c +++ b/src/util/src/ttypes.c @@ -976,11 +976,15 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) { break; } case TSDB_DATA_TYPE_FLOAT: { - *((float *)val) = GET_FLOAT_VAL(src); + float fv = GET_FLOAT_VAL(src); + SET_FLOAT_VAL_ALIGN(val, &fv); + //*((float *)val) = GET_FLOAT_VAL(src); break; }; case TSDB_DATA_TYPE_DOUBLE: { - *((double *)val) = GET_DOUBLE_VAL(src); + double dv = GET_DOUBLE_VAL(src); + SET_DOUBLE_VAL_ALIGN(val, &dv); + //*((double *)val) = GET_DOUBLE_VAL(src); break; }; case TSDB_DATA_TYPE_TIMESTAMP: From 58c9fafab698972dce48237a75d6060a540bb068 Mon Sep 17 00:00:00 2001 From: huili Date: Sun, 9 Feb 2020 18:39:00 +0800 Subject: [PATCH 5/9] [#1201] --- src/util/src/ttypes.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/util/src/ttypes.c b/src/util/src/ttypes.c index 80e816ad11..ae994cb77b 100644 --- a/src/util/src/ttypes.c +++ b/src/util/src/ttypes.c @@ -976,15 +976,21 @@ void assignVal(char *val, const char *src, int32_t len, int32_t type) { break; } case TSDB_DATA_TYPE_FLOAT: { + #ifdef _TD_ARM_32_ float fv = GET_FLOAT_VAL(src); SET_FLOAT_VAL_ALIGN(val, &fv); - //*((float *)val) = GET_FLOAT_VAL(src); + #else + *((float *)val) = GET_FLOAT_VAL(src); + #endif break; }; case TSDB_DATA_TYPE_DOUBLE: { + #ifdef _TD_ARM_32_ double dv = GET_DOUBLE_VAL(src); SET_DOUBLE_VAL_ALIGN(val, &dv); - //*((double *)val) = GET_DOUBLE_VAL(src); + #else + *((double *)val) = GET_DOUBLE_VAL(src); + #endif break; }; case TSDB_DATA_TYPE_TIMESTAMP: From 11e82045d994692a73b0f472ca2ba9119ec30ca1 Mon Sep 17 00:00:00 2001 From: slguan Date: Sun, 9 Feb 2020 22:27:15 +0800 Subject: [PATCH 6/9] for windows compile --- src/client/src/tscFunctionImpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index e02e0b3ceb..248b197d52 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -3194,7 +3194,7 @@ static void diff_function(SQLFunctionCtx *pCtx) { GET_RES_INFO(pCtx)->numOfRes += forwardStep; pCtx->aOutputBuf += forwardStep * pCtx->outputBytes; - pCtx->ptsOutputBuf += forwardStep * TSDB_KEYSIZE; + pCtx->ptsOutputBuf = (char*)pCtx->ptsOutputBuf + forwardStep * TSDB_KEYSIZE; } } From 0e6dfe292a633bde6a662e93892dee43e3c86f79 Mon Sep 17 00:00:00 2001 From: slguan Date: Mon, 10 Feb 2020 11:43:48 +0800 Subject: [PATCH 7/9] for windows compile --- src/client/src/taos.def | 2 -- src/util/CMakeLists.txt | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/src/taos.def b/src/client/src/taos.def index f6de4e8665..39906c7486 100644 --- a/src/client/src/taos.def +++ b/src/client/src/taos.def @@ -24,8 +24,6 @@ taos_fetch_row_a taos_subscribe taos_consume taos_unsubscribe -taos_subfields_count -taos_fetch_subfields taos_open_stream taos_close_stream taos_fetch_block diff --git a/src/util/CMakeLists.txt b/src/util/CMakeLists.txt index 4202092947..76664ef9ec 100644 --- a/src/util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -34,6 +34,7 @@ ELSEIF (TD_WINDOWS_64) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/iconv) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/deps/regex) INCLUDE_DIRECTORIES(${TD_COMMUNITY_DIR}/src/inc) + LIST(APPEND SRC ./src/hash.c) LIST(APPEND SRC ./src/ihash.c) LIST(APPEND SRC ./src/lz4.c) LIST(APPEND SRC ./src/shash.c) @@ -68,6 +69,7 @@ ELSEIF (TD_WINDOWS_64) TARGET_LINK_LIBRARIES(tutil iconv regex pthread os winmm IPHLPAPI ws2_32) ELSEIF(TD_DARWIN_64) ADD_DEFINITIONS(-DUSE_LIBICONV) + LIST(APPEND SRC ./src/hash.c) LIST(APPEND SRC ./src/ihash.c) LIST(APPEND SRC ./src/lz4.c) LIST(APPEND SRC ./src/shash.c) From bcda954fb5c074076eab34306839e7476e72b357 Mon Sep 17 00:00:00 2001 From: huili Date: Mon, 10 Feb 2020 16:09:32 +0800 Subject: [PATCH 8/9] [modify default for aarch32] --- src/util/src/tglobalcfg.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/util/src/tglobalcfg.c b/src/util/src/tglobalcfg.c index 034d293f05..45efcad563 100644 --- a/src/util/src/tglobalcfg.c +++ b/src/util/src/tglobalcfg.c @@ -80,7 +80,12 @@ short tsNumOfVnodesPerCore = 8; short tsNumOfTotalVnodes = 0; short tsCheckHeaderFile = 0; +#ifdef _TD_ARM_32_ +int tsSessionsPerVnode = 100; +#else int tsSessionsPerVnode = 1000; +#endif + int tsCacheBlockSize = 16384; // 256 columns int tsAverageCacheBlocks = TSDB_DEFAULT_AVG_BLOCKS; /** From 029c852e33e12a4c35e549ed630e9b50813eec17 Mon Sep 17 00:00:00 2001 From: huili Date: Mon, 10 Feb 2020 16:24:36 +0800 Subject: [PATCH 9/9] [modify describe arm] --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 299dd0190d..6efa0ff8ef 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,15 @@ mkdir build && cd build cmake .. && cmake --build . ``` -if compiling on an ARM processor(aarch64 or aarch32), you need add one parameter: +To compile on an ARM processor (aarch64 or aarch32), please add option CPUTYPE as below: -```cmd aarch64: +```cmd cmake .. -DCPUTYPE=aarch64 && cmake --build . +``` aarch32: +```cmd cmake .. -DCPUTYPE=aarch32 && cmake --build . ```