From 55e86072062dd9db4ac0bfe1bb8bd563ce033ba8 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Fri, 3 Nov 2023 10:17:23 +0800 Subject: [PATCH 1/3] fix: calc const optimization only when not tag scan --- source/libs/parser/src/parCalcConst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/libs/parser/src/parCalcConst.c b/source/libs/parser/src/parCalcConst.c index 23ce3aa77d..0657f1a43d 100644 --- a/source/libs/parser/src/parCalcConst.c +++ b/source/libs/parser/src/parCalcConst.c @@ -285,7 +285,7 @@ static SNode* createConstantValue() { static int32_t calcConstProjections(SCalcConstContext* pCxt, SSelectStmt* pSelect, bool subquery) { SNode* pProj = NULL; WHERE_EACH(pProj, pSelect->pProjectionList) { - if (subquery && !pSelect->isDistinct && isUselessCol((SExprNode*)pProj)) { + if (subquery && !pSelect->isDistinct && !pSelect->tagScan && isUselessCol((SExprNode*)pProj)) { ERASE_NODE(pSelect->pProjectionList); continue; } From 48cac9736bef61bc01caf6b11023ebd528837ccc Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Fri, 3 Nov 2023 10:32:23 +0800 Subject: [PATCH 2/3] enhance:add test case --- tests/script/tsim/query/tag_scan.sim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/script/tsim/query/tag_scan.sim b/tests/script/tsim/query/tag_scan.sim index 3f0a23fbd6..7404bd37fe 100644 --- a/tests/script/tsim/query/tag_scan.sim +++ b/tests/script/tsim/query/tag_scan.sim @@ -140,4 +140,28 @@ if $data01 != @1aa@ then return -1 endi +sql create table stb34 (ts timestamp, f int) tags(t int); +sql insert into ctb34 using stb34 tags(1) values(now, 1)(now+1s, 2); +sql select 1 from (select tags t from stb34 order by t) +print $rows +if $rows != 1 then + return -1 +endi + +sql select count(*) from (select tags t from stb34) +if $data00 != 1 then + return -1 +endi + + +sql select 1 from (select tags ts from stb34) +print $rows +if $rows != 2 then + return -1 +endi + +sql select count(*) from (select tags ts from stb34) +if $data00 != 2 then + return -1 +endi system sh/exec.sh -n dnode1 -s stop -x SIGINT From 06a4174c33eaf77ba12041b95fcc89bd5c0c553a Mon Sep 17 00:00:00 2001 From: slzhou Date: Mon, 6 Nov 2023 23:09:03 +0800 Subject: [PATCH 3/3] fix: increase taos-ws-py version to 0.3.1 --- tests/parallel_test/run_case.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/parallel_test/run_case.sh b/tests/parallel_test/run_case.sh index 1c57ed9b30..0a94eb645f 100755 --- a/tests/parallel_test/run_case.sh +++ b/tests/parallel_test/run_case.sh @@ -81,10 +81,10 @@ pip3 list|grep taospy pip3 uninstall taospy -y pip3 install --default-timeout=120 taospy==2.7.12 -#define taos-ws-py 0.2.8 +#define taos-ws-py 0.3.1 pip3 list|grep taos-ws-py pip3 uninstall taos-ws-py -y -pip3 install --default-timeout=120 taos-ws-py==0.2.8 +pip3 install --default-timeout=120 taos-ws-py==0.3.1 $TIMEOUT_CMD $cmd RET=$?