init push
This commit is contained in:
23
unittest/sql/rewrite/or_expand.sql
Normal file
23
unittest/sql/rewrite/or_expand.sql
Normal file
@ -0,0 +1,23 @@
|
||||
#case
|
||||
select * from t1 where c1 > 0 or c2 < 0;
|
||||
select * from t1 where c1 > 0 union all select * from t1 where c2 < 0 and lnnvl(c1 > 0);
|
||||
|
||||
#case 2
|
||||
select * from t1 where c1 > 0 or c2 < 0 or c1 = 1;
|
||||
select * from t1 where c1 > 0 union all select * from t1 where c2 < 0 and lnnvl(c1 > 0) union all select * from t1 where c1 = 1 and lnnvl(c1 > 0 or c2 < 0);
|
||||
|
||||
#case 3
|
||||
select * from t1 where c1 > 0 or c2 < 0;
|
||||
select * from t1 where c1 > 0 union all select * from t1 where c2 < 0 and lnnvl(c1 > 0);
|
||||
|
||||
#case 4
|
||||
select * from t1 where c1 = 1 or c1 = 2 or c1 = 3;
|
||||
select * from t1 where c1 = 1 union all select * from t1 where c1 = 2 and lnnvl(c1 = 1) union all select * from t1 where c1 = 3 and lnnvl(c1 = 1 or c1 = 2);
|
||||
|
||||
#case 5
|
||||
select c2 from t1 where c1 = 1 or c1 = 2 or c1 = 3;
|
||||
select c2 from t1 where c1 = 1 union all select c2 from t1 where c1 = 2 and lnnvl(c1 = 1) union all select c2 from t1 where c1 = 3 and lnnvl(c1 = 1 or c1 = 2);
|
||||
|
||||
#case 6
|
||||
select * from t1 where c1 > 0 or c2 < 0;
|
||||
select * from t1 where c1 > 0 union all select * from t1 where c2 < 0 and lnnvl(c1 > 0);
|
||||
Reference in New Issue
Block a user