fix: join on condition split issue
This commit is contained in:
parent
ff6de8ebe2
commit
667fe69fd1
|
@ -969,6 +969,9 @@ static int32_t pushDownCondOptDealJoin(SOptimizeContext* pCxt, SJoinLogicNode* p
|
||||||
|
|
||||||
if (NULL == pJoin->node.pConditions) {
|
if (NULL == pJoin->node.pConditions) {
|
||||||
int32_t code = pushDownCondOptJoinExtractCond(pCxt, pJoin);
|
int32_t code = pushDownCondOptJoinExtractCond(pCxt, pJoin);
|
||||||
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
|
code = pushDownCondOptJoinExtractEqualOnCond(pCxt, pJoin);
|
||||||
|
}
|
||||||
if (TSDB_CODE_SUCCESS == code) {
|
if (TSDB_CODE_SUCCESS == code) {
|
||||||
OPTIMIZE_FLAG_SET_MASK(pJoin->node.optimizedFlag, OPTIMIZE_FLAG_PUSH_DOWN_CONDE);
|
OPTIMIZE_FLAG_SET_MASK(pJoin->node.optimizedFlag, OPTIMIZE_FLAG_PUSH_DOWN_CONDE);
|
||||||
pCxt->optimized = true;
|
pCxt->optimized = true;
|
||||||
|
|
|
@ -106,6 +106,9 @@ class TDTestCase:
|
||||||
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.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.checkRows(0)
|
||||||
|
|
||||||
|
tdSql.query(f"select a.* from sta a join stb b on a.tg1=b.tg1 and a.ts=b.ts and a.tg2=b.tg2;")
|
||||||
|
tdSql.checkRows(12)
|
||||||
|
|
||||||
# tdSql.checkData(0,1,10)
|
# tdSql.checkData(0,1,10)
|
||||||
|
|
||||||
tdSql.error(f"select a.* from sta a join stb b on a.tg1=b.tg1 where a.ts=b.ts or a.tg2=b.tg2;")
|
tdSql.error(f"select a.* from sta a join stb b on a.tg1=b.tg1 where a.ts=b.ts or a.tg2=b.tg2;")
|
||||||
|
|
Loading…
Reference in New Issue