Skip to content

Commit

Permalink
add tests for inner join
Browse files Browse the repository at this point in the history
  • Loading branch information
leiysky committed May 7, 2022
1 parent 8eafa22 commit cd03b72
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/suites/0_stateless/20+_others/20_0001_planner_v2.result
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@
2
2
4
1 1
2 2
3 3
1 1
2 2
2 1
3 2
2 1
3 2
20 changes: 19 additions & 1 deletion tests/suites/0_stateless/20+_others/20_0001_planner_v2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,22 @@ select sum(a) from t group by a having sum(a) > 1;
select sum(a+1) from t group by a+1 having sum(a+1) = 2;
select sum(a+1) from t group by a+1, b having sum(a+1) > 3;
drop table t;
set enable_planner_v2 = 0;

-- Inner join
create table t(a int);
insert into t values(1),(2),(3);
create table t1(b float);
insert into t1 values(1.0),(2.0),(3.0);
create table t2(c uint32 null);
insert into t2 values(1),(2),(null);

select * from t inner join t1 on cast(t.a as float) = t1.b;
select * from t inner join t2 on t.a = t2.c;
select * from t inner join t2 on t.a = t2.c + 1;
select * from t inner join t2 on t.a = t2.c + 1 and t.a - 1 = t2.c;

drop table t;
drop table t1;
drop table t2;

set enable_planner_v2 = 0;

0 comments on commit cd03b72

Please sign in to comment.