Skip to content

Commit

Permalink
test: more case for insubquery
Browse files Browse the repository at this point in the history
  • Loading branch information
KKould committed Feb 28, 2024
1 parent 6c9838b commit ed3a196
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/optimizer/rule/normalization/pushdown_predicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl NormalizationRule for PushPredicateThroughJoin {
if let Operator::Join(child_op) = graph.operator(child_id) {
if !matches!(
child_op.join_type,
JoinType::Inner | JoinType::LeftOuter | JoinType::RightOuter
JoinType::Inner | JoinType::LeftOuter | JoinType::LeftSemi | JoinType::LeftAnti | JoinType::RightOuter
) {
return Ok(());
}
Expand Down
15 changes: 15 additions & 0 deletions tests/slt/subquery.slt
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,30 @@ select * from t1 where a <= (select 4) and (-a + 1) < (select 1) - 1
----
1 3 4

statement ok
insert into t1 values (2, 3, 3), (3, 1, 4);

query III
select * from t1 where a in (select 1)
----
0 1 2
3 1 4

query III
select * from t1 where a in (select 1) and b = 4
----
3 1 4

query III
select * from t1 where a not in (select 1)
----
1 3 4
2 3 3

query III
select * from t1 where a not in (select 1) and b = 3
----
2 3 3

statement ok
drop table t1;

0 comments on commit ed3a196

Please sign in to comment.