fix: join condition with single param operator
This commit is contained in:
parent
ef7eb478e4
commit
dd1457e49c
|
@ -812,7 +812,7 @@ static bool pushDownCondOptIsColEqualOnCond(SJoinLogicNode* pJoin, SNode* pCond,
|
|||
return false;
|
||||
}
|
||||
SOperatorNode* pOper = (SOperatorNode*)pCond;
|
||||
if (QUERY_NODE_COLUMN != nodeType(pOper->pLeft) || QUERY_NODE_COLUMN != nodeType(pOper->pRight)) {
|
||||
if (QUERY_NODE_COLUMN != nodeType(pOper->pLeft) || NULL == pOper->pRight || QUERY_NODE_COLUMN != nodeType(pOper->pRight)) {
|
||||
return false;
|
||||
}
|
||||
SColumnNode* pLeft = (SColumnNode*)(pOper->pLeft);
|
||||
|
|
|
@ -112,6 +112,18 @@ class TDTestCase:
|
|||
tdSql.query(f"select a.* from sta a join stb b on a.tg1 != b.tg1 and a.ts=b.ts;")
|
||||
tdSql.checkRows(36)
|
||||
|
||||
tdSql.query(f"select a.* from sta a join stb b on a.ts=b.ts and a.ts is null;")
|
||||
tdSql.checkRows(0)
|
||||
|
||||
tdSql.query(f"select a.* from sta a join stb b on a.ts=b.ts and a.ts is not null;")
|
||||
tdSql.checkRows(48)
|
||||
|
||||
tdSql.query(f"select a.* from sta a ,stb b where a.ts=b.ts and a.ts is null;")
|
||||
tdSql.checkRows(0)
|
||||
|
||||
tdSql.query(f"select a.* from sta a ,stb b where a.ts=b.ts and a.ts is not null;")
|
||||
tdSql.checkRows(48)
|
||||
|
||||
# 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;")
|
||||
|
|
Loading…
Reference in New Issue