1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-18844 Implement EXCEPT ALL and INTERSECT ALL operations

This commit is contained in:
WayneXia
2019-08-24 21:42:35 +08:00
parent afe969ba05
commit a896bebfa6
20 changed files with 4813 additions and 250 deletions

View File

@ -66,7 +66,6 @@ select 1 from dual ORDER BY 1 intersect select 1 from dual;
select 1 as a from dual union all select 1 from dual;
--error ER_PARSE_ERROR
select 1 from dual intersect all select 1 from dual;
@ -147,12 +146,6 @@ insert into t3 values (1,1),(3,3);
(select a,b from t1) union (select c,d from t2) intersect (select e,f from t3) union (select 4,4);
explain extended
(select a,b from t1) union (select c,d from t2) intersect (select e,f from t3) union (select 4,4);
set SQL_MODE=ORACLE;
--sorted_result
(select a,b from t1) union (select c,d from t2) intersect (select e,f from t3) union (select 4,4);
explain extended
(select a,b from t1) union (select c,d from t2) intersect (select e,f from t3) union (select 4,4);
set SQL_MODE=default;
# test result of linear mix operation
@ -160,12 +153,6 @@ set SQL_MODE=default;
(select e,f from t3) intersect (select c,d from t2) union (select a,b from t1) union (select 4,4);
explain extended
(select e,f from t3) intersect (select c,d from t2) union (select a,b from t1) union (select 4,4);
set SQL_MODE=ORACLE;
--sorted_result
(select e,f from t3) intersect (select c,d from t2) union (select a,b from t1) union (select 4,4);
explain extended
(select e,f from t3) intersect (select c,d from t2) union (select a,b from t1) union (select 4,4);
set SQL_MODE=default;
--sorted_result
(/* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1`) union /* select#3 */ select `__3`.`c` AS `c`,`__3`.`d` AS `d` from ((/* select#2 */ select `test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2`) intersect (/* select#4 */ select `test`.`t3`.`e` AS `e`,`test`.`t3`.`f` AS `f` from `test`.`t3`)) `__3` union (/* select#5 */ select 4 AS `4`,4 AS `4`);
@ -310,11 +297,7 @@ create table t234(c1 int);
insert into t234 values(2);
insert into t234 values(3);
insert into t234 values(4);
set SQL_MODE=oracle;
--sorted_result
select * from t13 union select * from t234 intersect select * from t12;
set SQL_MODE=default;
--sorted_result
select * from t13 union select * from t234 intersect select * from t12;
@ -333,7 +316,7 @@ insert into t2 values (4), (5), (9), (1), (8), (9);
create table t3 (a int);
insert into t3 values (8), (1), (8), (2), (3), (7), (2);
--sorted_result
select * from t1 where a > 4
union all
select * from t2 where a < 5