diff --git a/cmake/version.inc b/cmake/version.inc index 261e3e8162f1bae6498f6edc09f23cb243e1f5c2..30b69c2401e2facac8708fdabb83a885cb50cd31 100755 --- a/cmake/version.inc +++ b/cmake/version.inc @@ -4,7 +4,7 @@ PROJECT(TDengine) IF (DEFINED VERNUMBER) SET(TD_VER_NUMBER ${VERNUMBER}) ELSE () - SET(TD_VER_NUMBER "2.1.7.2") + SET(TD_VER_NUMBER "2.2.0.0") ENDIF () IF (DEFINED VERCOMPATIBLE) diff --git a/deps/TSZ b/deps/TSZ index ceda5bf9fcd7836509ac97dcc0056b3f1dd48cc5..11c1060d4f917dd799ae628b131db5d6a5ef6954 160000 --- a/deps/TSZ +++ b/deps/TSZ @@ -1 +1 @@ -Subproject commit ceda5bf9fcd7836509ac97dcc0056b3f1dd48cc5 +Subproject commit 11c1060d4f917dd799ae628b131db5d6a5ef6954 diff --git a/packaging/tools/make_install.sh b/packaging/tools/make_install.sh index 0849a76e31a631bae7a6ba0d6ef7ffcb58b8480b..d400d0b91a2d02e9b3e0232d67e2ed6b00cdf541 100755 --- a/packaging/tools/make_install.sh +++ b/packaging/tools/make_install.sh @@ -20,44 +20,33 @@ fi # Dynamic directory - if [ "$osType" != "Darwin" ]; then data_dir="/var/lib/taos" log_dir="/var/log/taos" -else - data_dir="/usr/local/var/lib/taos" - log_dir="/usr/local/var/log/taos" -fi -if [ "$osType" != "Darwin" ]; then cfg_install_dir="/etc/taos" -else - cfg_install_dir="/usr/local/etc/taos" -fi -if [ "$osType" != "Darwin" ]; then bin_link_dir="/usr/bin" lib_link_dir="/usr/lib" lib64_link_dir="/usr/lib64" inc_link_dir="/usr/include" + + install_main_dir="/usr/local/taos" + + bin_dir="/usr/local/taos/bin" else + data_dir="/usr/local/var/lib/taos" + log_dir="/usr/local/var/log/taos" + + cfg_install_dir="/usr/local/etc/taos" + bin_link_dir="/usr/local/bin" lib_link_dir="/usr/local/lib" inc_link_dir="/usr/local/include" -fi -#install main path -if [ "$osType" != "Darwin" ]; then - install_main_dir="/usr/local/taos" -else install_main_dir="/usr/local/Cellar/tdengine/${verNumber}" -fi -# old bin dir -if [ "$osType" != "Darwin" ]; then - bin_dir="/usr/local/taos/bin" -else - bin_dir="/usr/local/Cellar/tdengine/${verNumber}/bin" + bin_dir="/usr/local/Cellar/tdengine/${verNumber}/bin" fi service_config_dir="/etc/systemd/system" @@ -254,7 +243,10 @@ function install_lib() { ${csudo} ln -sf ${lib64_link_dir}/libtaos.so.1 ${lib64_link_dir}/libtaos.so fi else - ${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.* ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/* + ${csudo} cp -Rf ${binary_dir}/build/lib/libtaos.${verNumber}.dylib ${install_main_dir}/driver && ${csudo} chmod 777 ${install_main_dir}/driver/* + + ${csudo} ln -sf ${install_main_dir}/driver/libtaos.* ${lib_link_dir}/libtaos.1.dylib + ${csudo} ln -sf ${lib_link_dir}/libtaos.1.dylib ${lib_link_dir}/libtaos.dylib fi install_jemalloc diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index ea5ce3bc52468d7efcc1ece78f46cbbc8c2c3a7e..e4fdae558c3282eee4d2c6d0591b01fff53a1f98 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: tdengine base: core18 -version: '2.1.7.2' +version: '2.2.0.0' icon: snap/gui/t-dengine.svg summary: an open-source big data platform designed and optimized for IoT. description: | @@ -72,7 +72,7 @@ parts: - usr/bin/taosd - usr/bin/taos - usr/bin/taosdemo - - usr/lib/libtaos.so.2.1.7.2 + - usr/lib/libtaos.so.2.2.0.0 - usr/lib/libtaos.so.1 - usr/lib/libtaos.so diff --git a/src/client/src/tscServer.c b/src/client/src/tscServer.c index a6446a49fc8c997207fcbeb9a963e7cf4a1ae227..0239805e9c7de7d8ffb2ad3b6175792fdd6c2acf 100644 --- a/src/client/src/tscServer.c +++ b/src/client/src/tscServer.c @@ -2355,6 +2355,7 @@ int tscProcessRetrieveFuncRsp(SSqlObj* pSql) { parQueryInfo->pUdfInfo = pQueryInfo->pUdfInfo; // assigned to parent sql obj. pQueryInfo->pUdfInfo = NULL; + taosReleaseRef(tscObjRef, parent->self); return TSDB_CODE_SUCCESS; } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 0e414e36c884b0a1866f0a735cf235121eb63065..a71ed588dba32ffae12408b289bda21dea112f8e 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -1516,6 +1516,8 @@ void tscFreeSqlObj(SSqlObj* pSql) { return; } + int64_t sid = pSql->self; + tscDebug("0x%"PRIx64" start to free sqlObj", pSql->self); pSql->res.code = TSDB_CODE_TSC_QUERY_CANCELLED; @@ -1547,6 +1549,8 @@ void tscFreeSqlObj(SSqlObj* pSql) { tfree(pCmd->payload); pCmd->allocSize = 0; + tscDebug("0x%"PRIx64" addr:%p free completed", sid, pSql); + tsem_destroy(&pSql->rspSem); memset(pSql, 0, sizeof(*pSql)); free(pSql); diff --git a/src/kit/taospack/taospack.c b/src/kit/taospack/taospack.c index ddb9e660af4b4c479c0d8bc4b8be47c9f900dfce..9e7355b42af8fe296975f78960639de0a43a4d18 100644 --- a/src/kit/taospack/taospack.c +++ b/src/kit/taospack/taospack.c @@ -712,6 +712,15 @@ void leakTest(){ } #define DB_CNT 500 +void test_same_float(int algo, bool lossy){ + float ori = 123.456789123; + float floats [DB_CNT]; + for(int i=0; i< DB_CNT; i++){ + floats[i] = ori; + } + DoFloat(floats, DB_CNT, algo, lossy); +} + void test_same_double(int algo){ double ori = 3.1415926; @@ -721,7 +730,6 @@ void test_same_double(int algo){ } DoDouble(doubles, DB_CNT, algo); - } #ifdef TD_TSZ @@ -781,6 +789,10 @@ int main(int argc, char *argv[]) { return 0; } + if(strcmp(argv[1], "-samef") == 0) { + test_same_float(atoi(argv[2]), true); + return 0; + } if(strcmp(argv[1], "-samed") == 0) { test_same_double(atoi(argv[2])); return 0; diff --git a/src/util/src/tarray.c b/src/util/src/tarray.c index d0d126c1e4d7f2e7c0913585df6031b556291fc3..2d6c513cb57ce1d524a1fb69df68702e624ede7b 100644 --- a/src/util/src/tarray.c +++ b/src/util/src/tarray.c @@ -112,14 +112,15 @@ void taosArrayRemoveBatch(SArray *pArray, const int32_t* pData, int32_t numOfEle i += 1; } - assert(i == pData[numOfElems - 1] + 1); + assert(i == pData[numOfElems - 1] + 1 && i <= size); - int32_t dstIndex = pData[numOfElems - 1] - numOfElems + 1; int32_t srcIndex = pData[numOfElems - 1] + 1; - - char* dst = TARRAY_GET_ELEM(pArray, dstIndex); - char* src = TARRAY_GET_ELEM(pArray, srcIndex); - memmove(dst, src, pArray->elemSize * (pArray->size - numOfElems)); + int32_t dstIndex = pData[numOfElems - 1] - numOfElems + 1; + if (pArray->size - srcIndex > 0) { + char* dst = TARRAY_GET_ELEM(pArray, dstIndex); + char* src = TARRAY_GET_ELEM(pArray, srcIndex); + memmove(dst, src, pArray->elemSize * (pArray->size - srcIndex)); + } pArray->size -= numOfElems; } diff --git a/tests/pytest/client/version.py b/tests/pytest/client/version.py index ca6ce69780159bd819655c9c6a0b46de5e07bc70..0dbddbe9b5d86a9abf5c102d72b7f4b3e36eceaa 100644 --- a/tests/pytest/client/version.py +++ b/tests/pytest/client/version.py @@ -28,20 +28,20 @@ class TDTestCase: sql = "select server_version()" ret = tdSql.query(sql) - version = tdSql.getData(0, 0)[0:3] - expectedVersion_dev = "2.0" - expectedVersion_master = "2.1" - if(version == expectedVersion_dev or version == expectedVersion_master): - tdLog.info("sql:%s, row:%d col:%d data:%s == expect" % (sql, 0, 0, version)) + version = floor(float(tdSql.getData(0, 0)[0:3])) + expectedVersion = 2 + if(version == expectedVersion): + tdLog.info("sql:%s, row:%d col:%d data:%d == expect" % (sql, 0, 0, version)) else: - tdLog.exit("sql:%s, row:%d col:%d data:%s != expect:%s or %s " % (sql, 0, 0, version, expectedVersion_dev, expectedVersion_master)) + tdLog.exit("sql:%s, row:%d col:%d data:%d != expect:%d " % (sql, 0, 0, version, expectedVersion)) + sql = "select client_version()" ret = tdSql.query(sql) version = floor(float(tdSql.getData(0, 0)[0:3])) expectedVersion = 2 if(version == expectedVersion): - tdLog.info("sql:%s, row:%d col:%d data:%s == expect" % (sql, 0, 0, version)) + tdLog.info("sql:%s, row:%d col:%d data:%d == expect" % (sql, 0, 0, version)) else: tdLog.exit("sql:%s, row:%d col:%d data:%d != expect:%d " % (sql, 0, 0, version, expectedVersion))