From 5faf7d967d8b2b3d518c81ce801ee9ab8f72517d Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Tue, 22 Aug 2023 13:55:45 +0800 Subject: [PATCH] fix: table version release issue --- source/libs/planner/src/planOptimizer.c | 2 +- source/libs/qworker/src/qwUtil.c | 2 +- tests/system-test/2-query/stbJoin.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/source/libs/planner/src/planOptimizer.c b/source/libs/planner/src/planOptimizer.c index 2db0c8c54b..7ce6994ce6 100644 --- a/source/libs/planner/src/planOptimizer.c +++ b/source/libs/planner/src/planOptimizer.c @@ -3192,7 +3192,7 @@ static bool stbJoinOptShouldBeOptimized(SLogicNode* pNode) { } SJoinLogicNode* pJoin = (SJoinLogicNode*)pNode; - if (pJoin->isSingleTableJoin || NULL == pJoin->pTagEqCond || pNode->pChildren->length != 2 + if (pJoin->isSingleTableJoin || NULL == pJoin->pTagEqCond || NULL != pJoin->pTagOnCond || pNode->pChildren->length != 2 || pJoin->hasSubQuery || pJoin->joinAlgo != JOIN_ALGO_UNKNOWN || pJoin->isLowLevelJoin) { if (pJoin->joinAlgo == JOIN_ALGO_UNKNOWN) { pJoin->joinAlgo = JOIN_ALGO_MERGE; diff --git a/source/libs/qworker/src/qwUtil.c b/source/libs/qworker/src/qwUtil.c index 2ce920a9d2..3b127ee780 100644 --- a/source/libs/qworker/src/qwUtil.c +++ b/source/libs/qworker/src/qwUtil.c @@ -314,7 +314,6 @@ void qwFreeTaskCtx(SQWTaskCtx *ctx) { } taosArrayDestroy(ctx->tbInfo); - ctx->tbInfo = NULL; } int32_t qwDropTaskCtx(QW_FPARAMS_DEF) { @@ -341,6 +340,7 @@ int32_t qwDropTaskCtx(QW_FPARAMS_DEF) { } qwFreeTaskCtx(&octx); + ctx->tbInfo = NULL; QW_TASK_DLOG_E("task ctx dropped"); diff --git a/tests/system-test/2-query/stbJoin.py b/tests/system-test/2-query/stbJoin.py index ce6da6eb1c..3913a8159f 100644 --- a/tests/system-test/2-query/stbJoin.py +++ b/tests/system-test/2-query/stbJoin.py @@ -103,6 +103,8 @@ class TDTestCase: tdSql.query(f"select /*+ no_batch_scan() */ count(*) from sta a, stb b where a.tg1=b.tg1 and a.ts=b.ts and b.tg2 > 'a' interval(1a);") tdSql.checkRows(3) + tdSql.query(f"select a.ts, b.ts from sta a, stb b where a.ts=b.ts and (a.t0=b.t0 and a.t0 > b.t0);") + tdSql.checkRows(0) # tdSql.checkData(0,1,10)