diff --git a/tests/suites/0_stateless/20+_others/20_0001_planner_v2.result b/tests/suites/0_stateless/20+_others/20_0001_planner_v2.result index 0de2784364746..cc5a5397af2ea 100644 --- a/tests/suites/0_stateless/20+_others/20_0001_planner_v2.result +++ b/tests/suites/0_stateless/20+_others/20_0001_planner_v2.result @@ -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 diff --git a/tests/suites/0_stateless/20+_others/20_0001_planner_v2.sql b/tests/suites/0_stateless/20+_others/20_0001_planner_v2.sql index 660248a9bd1c3..50c9ef310a0d3 100644 --- a/tests/suites/0_stateless/20+_others/20_0001_planner_v2.sql +++ b/tests/suites/0_stateless/20+_others/20_0001_planner_v2.sql @@ -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; \ No newline at end of file + +-- 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;