summaryrefslogtreecommitdiff
path: root/mysql-test/t/except.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/except.test')
-rw-r--r--mysql-test/t/except.test40
1 files changed, 36 insertions, 4 deletions
diff --git a/mysql-test/t/except.test b/mysql-test/t/except.test
index 11d4702012a..8bf22180731 100644
--- a/mysql-test/t/except.test
+++ b/mysql-test/t/except.test
@@ -1,5 +1,5 @@
-create table t1 (a int, b int);
-create table t2 (c int, d int);
+create table t1 (a int, b int) engine=MyISAM;
+create table t2 (c int, d int) engine=MyISAM;
insert into t1 values (1,1),(2,2);
insert into t2 values (2,2),(3,3);
@@ -26,6 +26,38 @@ execute stmt;
drop tables t1,t2;
+create table t1 (a int, b int) engine=MyISAM;
+create table t2 (c int, d int) engine=MyISAM;
+create table t3 (e int, f int) engine=MyISAM;
+create table t4 (g int, h int) engine=MyISAM;
+insert into t1 values (1,1),(2,2);
+insert into t2 values (2,2),(3,3);
+insert into t3 values (4,4),(5,5);
+insert into t4 values (4,4),(7,7);
+
+(select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4);
+EXPLAIN (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4);
+EXPLAIN (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4);
+EXPLAIN extended select * from ((select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4)) a;
+EXPLAIN format=json (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4);
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+ANALYZE format=json (select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4);
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+ANALYZE format=json select * from ((select a,b,e,f from t1,t3) except
+(select c,d,g,h from t2,t4)) a;
+select * from ((select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4)) a;
+
+prepare stmt from "(select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4)";
+execute stmt;
+execute stmt;
+
+prepare stmt from "select * from ((select a,b,e,f from t1,t3) except (select c,d,g,h from t2,t4)) a";
+execute stmt;
+execute stmt;
+
+drop tables t1,t2,t3,t4;
+
select 1 as a from dual except select 1 from dual;
(select 1 from dual) except (select 1 from dual);
--error ER_WRONG_USAGE
@@ -38,8 +70,8 @@ select 1 as a from dual union all select 1 from dual;
select 1 from dual except all select 1 from dual;
-create table t1 (a int, b blob, a1 int, b1 blob);
-create table t2 (c int, d blob, c1 int, d1 blob);
+create table t1 (a int, b blob, a1 int, b1 blob) engine=MyISAM;
+create table t2 (c int, d blob, c1 int, d1 blob) engine=MyISAM;
insert into t1 values (1,"ddd", 1, "sdfrrwwww"),(2, "fgh", 2, "dffggtt");
insert into t2 values (2, "fgh", 2, "dffggtt"),(3, "ffggddd", 3, "dfgg");