diff --git a/README-CN.md b/README-CN.md index 8c78bb14ee..43d3c76a73 100644 --- a/README-CN.md +++ b/README-CN.md @@ -188,7 +188,7 @@ cmake .. && cmake --build . 如果你想要编译 taosAdapter,需要添加 `-DBUILD_HTTP=false` 选项。 -如果你想要编译 taosKeeper,需要添加 `--DBUILD_KEEPER=true` 选项。 +如果你想要编译 taosKeeper,需要添加 `-DBUILD_KEEPER=true` 选项。 diff --git a/README.md b/README.md index 17079de0a7..568bb82cfb 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ make If you want to compile taosAdapter, you need to add the `-DBUILD_HTTP=false` option. -If you want to compile taosKeeper, you need to add the `--DBUILD_KEEPER=true` option. +If you want to compile taosKeeper, you need to add the `-DBUILD_KEEPER=true` option. You can use Jemalloc as memory allocator instead of glibc: @@ -206,7 +206,7 @@ cmake .. && cmake --build . If you want to compile taosAdapter, you need to add the `-DBUILD_HTTP=false` option. -If you want to compile taosKeeper, you need to add the `--DBUILD_KEEPER=true` option. +If you want to compile taosKeeper, you need to add the `-DBUILD_KEEPER=true` option. diff --git a/docs/zh/14-reference/01-components/01-taosd.md b/docs/zh/14-reference/01-components/01-taosd.md index 159b066313..b99fc5f24b 100644 --- a/docs/zh/14-reference/01-components/01-taosd.md +++ b/docs/zh/14-reference/01-components/01-taosd.md @@ -686,7 +686,7 @@ charset 的有效值是 UTF-8。 #### numOfMnodeReadThreads - 说明:mnode 的 Read 线程数目 - 类型:整数 -- 默认值:CPU 核数的四分之一(不超过 4) +- 默认值:CPU 核数的四分之一(不低于 1 不超过 4) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -695,7 +695,7 @@ charset 的有效值是 UTF-8。 #### numOfVnodeQueryThreads - 说明:vnode 的 Query 线程数目 - 类型:整数 -- 默认值:CPU 核数的两倍(不超过 16) +- 默认值:CPU 核数的两倍(不低于 16) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -704,7 +704,7 @@ charset 的有效值是 UTF-8。 #### numOfVnodeFetchThreads - 说明:vnode 的 Fetch 线程数目 - 类型:整数 -- 默认值:CPU 核数的四分之一(不超过 4) +- 默认值:CPU 核数的四分之一(不低于 4) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -713,7 +713,7 @@ charset 的有效值是 UTF-8。 #### numOfVnodeRsmaThreads - 说明:vnode 的 Rsma 线程数目 - 类型:整数 -- 默认值:CPU 核数的四分之一(不超过 4) +- 默认值:CPU 核数的四分之一(不低于 4) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -722,7 +722,7 @@ charset 的有效值是 UTF-8。 #### numOfQnodeQueryThreads - 说明:qnode 的 Query 线程数目 - 类型:整数 -- 默认值:CPU 核数的两倍(不超过 16) +- 默认值:CPU 核数的两倍(不低于 16) - 最小值:0 - 最大值:1024 - 动态修改:支持通过 SQL 修改,重启生效。 @@ -1007,15 +1007,15 @@ charset 的有效值是 UTF-8。 #### udfdResFuncs - 说明:用于统计用量 **`内部参数`** -- 类型:整数 +- 类型:字符串 - 动态修改:支持通过 SQL 修改,重启生效。 - 支持版本:从 v3.1.0.0 版本开始引入 #### udfdLdLibPath - 说明:用于统计用量 **`内部参数`** -- 类型:整数 -- 动态修改:支持通过 SQL 修改,重启生效 -- 支持版本:v3.1.0.0 引入 +- 类型:字符串 +- 动态修改:支持通过 SQL 修改,重启生效。 +- 支持版本:从 v3.1.0.0 版本开始引入 #### enableStrongPassword - 说明:密码要符合一个要求:至少包含大写字母、小写字母、数字、特殊字符中的三类。特殊字符包括 `! @ # $ % ^ & * ( ) - _ + = [ ] { } : ; > < ? | ~ , .` diff --git a/source/client/src/clientStmt.c b/source/client/src/clientStmt.c index fe9388db51..2d9001d248 100644 --- a/source/client/src/clientStmt.c +++ b/source/client/src/clientStmt.c @@ -1631,20 +1631,20 @@ int stmtClose(TAOS_STMT* stmt) { STMT_DLOG_E("start to free stmt"); - pStmt->queue.stopQueue = true; - - (void)taosThreadMutexLock(&pStmt->queue.mutex); - (void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); - (void)taosThreadCondSignal(&(pStmt->queue.waitCond)); - (void)taosThreadMutexUnlock(&pStmt->queue.mutex); - if (pStmt->bindThreadInUse) { + pStmt->queue.stopQueue = true; + + (void)taosThreadMutexLock(&pStmt->queue.mutex); + (void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); + (void)taosThreadCondSignal(&(pStmt->queue.waitCond)); + (void)taosThreadMutexUnlock(&pStmt->queue.mutex); + (void)taosThreadJoin(pStmt->bindThread, NULL); pStmt->bindThreadInUse = false; - } - (void)taosThreadCondDestroy(&pStmt->queue.waitCond); - (void)taosThreadMutexDestroy(&pStmt->queue.mutex); + (void)taosThreadCondDestroy(&pStmt->queue.waitCond); + (void)taosThreadMutexDestroy(&pStmt->queue.mutex); + } STMT_DLOG("stmt %p closed, stbInterlaceMode:%d, statInfo: ctgGetTbMetaNum=>%" PRId64 ", getCacheTbInfo=>%" PRId64 ", parseSqlNum=>%" PRId64 ", pStmt->stat.bindDataNum=>%" PRId64 diff --git a/source/client/src/clientStmt2.c b/source/client/src/clientStmt2.c index c8b6abfbd1..994be0c2bd 100644 --- a/source/client/src/clientStmt2.c +++ b/source/client/src/clientStmt2.c @@ -1928,16 +1928,19 @@ int stmtClose2(TAOS_STMT2* stmt) { STMT_DLOG_E("start to free stmt"); - pStmt->queue.stopQueue = true; - - (void)taosThreadMutexLock(&pStmt->queue.mutex); - (void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); - (void)taosThreadCondSignal(&(pStmt->queue.waitCond)); - (void)taosThreadMutexUnlock(&pStmt->queue.mutex); - if (pStmt->bindThreadInUse) { + pStmt->queue.stopQueue = true; + + (void)taosThreadMutexLock(&pStmt->queue.mutex); + (void)atomic_add_fetch_64(&pStmt->queue.qRemainNum, 1); + (void)taosThreadCondSignal(&(pStmt->queue.waitCond)); + (void)taosThreadMutexUnlock(&pStmt->queue.mutex); + (void)taosThreadJoin(pStmt->bindThread, NULL); pStmt->bindThreadInUse = false; + + (void)taosThreadCondDestroy(&pStmt->queue.waitCond); + (void)taosThreadMutexDestroy(&pStmt->queue.mutex); } TSC_ERR_RET(taosThreadMutexLock(&pStmt->asyncBindParam.mutex)); @@ -1946,9 +1949,6 @@ int stmtClose2(TAOS_STMT2* stmt) { } TSC_ERR_RET(taosThreadMutexUnlock(&pStmt->asyncBindParam.mutex)); - (void)taosThreadCondDestroy(&pStmt->queue.waitCond); - (void)taosThreadMutexDestroy(&pStmt->queue.mutex); - (void)taosThreadCondDestroy(&pStmt->asyncBindParam.waitCond); (void)taosThreadMutexDestroy(&pStmt->asyncBindParam.mutex); diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index f9f3f5843e..a1113adac5 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -6786,7 +6786,7 @@ int32_t createTableMergeScanOperatorInfo(STableScanPhysiNode* pTableScanNode, SR pInfo->mergeLimit = -1; bool hasLimit = pInfo->limitInfo.limit.limit != -1 || pInfo->limitInfo.limit.offset != -1; if (hasLimit) { - pInfo->mergeLimit = pInfo->limitInfo.limit.limit + pInfo->limitInfo.limit.offset; + pInfo->mergeLimit = pInfo->limitInfo.limit.offset != -1 ? pInfo->limitInfo.limit.limit + pInfo->limitInfo.limit.offset : pInfo->limitInfo.limit.limit; pInfo->mSkipTables = NULL; } diff --git a/tests/system-test/2-query/large_data.py b/tests/system-test/2-query/large_data.py index 2279c3ce70..70353fc2d6 100644 --- a/tests/system-test/2-query/large_data.py +++ b/tests/system-test/2-query/large_data.py @@ -43,10 +43,56 @@ class TDTestCase: tdSql.query("select d0.ts from test.d0 left join test.d1 on d0.ts=d1.ts limit 1000000;") tdSql.checkRows(num1) + + def ts6136(self): + start = 1500000000000 + tdSql.execute("drop database if exists test1;") + + tdCases.taosBenchmarkExec(f"-d test1 -t 3 -n 1000000 -s {start} -y") + + while True: + tdSql.query("select count(*) from test1.meters;") + tdSql.checkRowCol(0, 0) + if tdSql.queryResult[0][0] == 3000000: + tdLog.info(f"ts6136 data ready, sum: {tdSql.queryResult[0][0]}") + break + tdLog.info(f"waiting for data ready, sum: {tdSql.queryResult[0][0]}") + time.sleep(1) + + tdSql.query(f"insert into test1.d0 values({start + 962000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 961000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 960000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 602000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d1 values({start + 602000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 302000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 2000}, 1, 1, 1);") + tdSql.query(f"insert into test1.d0 values({start + 0}, 1, 1, 1);") + + # Query with limit 20 and store the results + tdSql.query("select tbname, ts, current from test1.meters where current = 1 and voltage = 1 and phase = 1 order by ts desc limit 8;") + tdSql.checkRows(8) + + tbname_list = [row[0] for row in tdSql.queryResult] + ts_list = [row[1] for row in tdSql.queryResult] + + # Test with different limits + for limit in range(1, 10): + row = min(8, limit) + tdSql.query(f"select tbname, ts, current from test1.meters where current = 1 and voltage = 1 and phase = 1 order by ts desc limit {limit};") + tdSql.checkRows(row) + result = tdSql.queryResult[:row] + + for i in range(min(10, len(result))): + tdSql.checkData(i, 0, tbname_list[i]) + tdSql.checkData(i, 1, ts_list[i]) + + tdLog.info("All tests passed for ts6136") + def run(self): self.prepare_data() self.ts5803() + self.ts6136() def stop(self): tdSql.close()