summaryrefslogtreecommitdiffstats
path: root/mysql-test/main/set_operation_oracle.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:04:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 18:04:16 +0000
commita68fb2d8219f6bccc573009600e9f23e89226a5e (patch)
treed742d35d14ae816e99293d2b01face30e9f3a46b /mysql-test/main/set_operation_oracle.test
parentInitial commit. (diff)
downloadmariadb-10.6-upstream.tar.xz
mariadb-10.6-upstream.zip
Adding upstream version 1:10.6.11.upstream/1%10.6.11upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/main/set_operation_oracle.test')
-rw-r--r--mysql-test/main/set_operation_oracle.test76
1 files changed, 76 insertions, 0 deletions
diff --git a/mysql-test/main/set_operation_oracle.test b/mysql-test/main/set_operation_oracle.test
new file mode 100644
index 00000000..52152b83
--- /dev/null
+++ b/mysql-test/main/set_operation_oracle.test
@@ -0,0 +1,76 @@
+# from intersect.test
+create table t1 (a int, b blob) engine=MyISAM;
+create table t2 (c int, d blob) engine=MyISAM;
+create table t3 (e int, f blob) engine=MyISAM;
+insert into t1 values (5,5),(6,6);
+insert into t2 values (2,2),(3,3);
+insert into t3 values (1,1),(3,3);
+
+set SQL_MODE=ORACLE;
+
+(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);
+
+
+(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);
+
+create table t12(c1 int);
+insert into t12 values(1);
+insert into t12 values(2);
+create table t13(c1 int);
+insert into t13 values(1);
+insert into t13 values(3);
+create table t234(c1 int);
+insert into t234 values(2);
+insert into t234 values(3);
+insert into t234 values(4);
+
+#enable after fix MDEV-29553
+--disable_view_protocol
+select * from t13 union select * from t234 intersect select * from t12;
+--enable_view_protocol
+set SQL_MODE=default;
+
+drop table t1,t2,t3;
+drop table t12,t13, t234;
+
+#from intersect_all.test
+create table t1 (a int, b blob) engine=MyISAM;
+create table t2 (c int, d blob) engine=MyISAM;
+create table t3 (e int, f blob) engine=MyISAM;
+insert into t1 values (5,5),(6,6);
+insert into t2 values (2,2),(3,3);
+insert into t3 values (1,1),(3,3);
+
+set SQL_MODE=ORACLE;
+
+#enable after fix MDEV-29553
+--disable_view_protocol
+select a,b from t1 union all select c,d from t2 intersect select e,f from t3 union all select 4,'4' from dual;
+explain extended
+select a,b from t1 union all select c,d from t2 intersect select e,f from t3 union all select 4,'4' from dual;
+
+select a,b from t1 union all select c,d from t2 intersect all select e,f from t3 union all select 4,'4' from dual;
+explain extended
+select a,b from t1 union all select c,d from t2 intersect all select e,f from t3 union all select 4,'4' from dual;
+--enable_view_protocol
+
+select e,f from t3 intersect select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual;
+explain extended
+select e,f from t3 intersect select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual;
+
+select e,f from t3 intersect all select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual;
+explain extended
+select e,f from t3 intersect all select c,d from t2 union all select a,b from t1 union all select 4,'4' from dual;
+
+set SQL_MODE=default;
+
+drop table t1,t2,t3;
+
+set SQL_MODE=oracle;
+--error ER_NO_SUCH_TABLE
+select * from t13 union select * from t234 intersect all select * from t12;
+set SQL_MODE=default;