Skip to content

Commit

Permalink
Merge pull request #22514 from taosdata/enh/TD-25794
Browse files Browse the repository at this point in the history
fix: table version release issue
  • Loading branch information
dapan1121 committed Aug 22, 2023
2 parents e069d72 + 8181c91 commit cbf1983
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/libs/planner/src/planOptimizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source/libs/qworker/src/qwUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ void qwFreeTaskCtx(SQWTaskCtx *ctx) {
}

taosArrayDestroy(ctx->tbInfo);
ctx->tbInfo = NULL;
}

int32_t qwDropTaskCtx(QW_FPARAMS_DEF) {
Expand All @@ -341,6 +340,7 @@ int32_t qwDropTaskCtx(QW_FPARAMS_DEF) {
}

qwFreeTaskCtx(&octx);
ctx->tbInfo = NULL;

QW_TASK_DLOG_E("task ctx dropped");

Expand Down
2 changes: 2 additions & 0 deletions tests/system-test/2-query/stbJoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def run(self):
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.tg1=b.tg1 and a.tg1 > b.tg1);")
tdSql.checkRows(0)

# tdSql.checkData(0,1,10)

Expand Down

0 comments on commit cbf1983

Please sign in to comment.