summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-08-03 16:09:36 -0600
committerunknown <sasha@mysql.sashanet.com>2001-08-03 16:09:36 -0600
commit8d89555e4602d817b6ebc449635cca47e3380b90 (patch)
tree97ccb13c4b0a44d464a0cca69c725323df8422b9 /mysql-test
parent0dab9f40e1c52ac00e1ca291785ae7943dea577e (diff)
parenta8f2c247ec2a915985596ef74a3804f624cdd5d3 (diff)
downloadmariadb-git-8d89555e4602d817b6ebc449635cca47e3380b90.tar.gz
Merge work:/home/bk/mysql-4.0
into mysql.sashanet.com:/home/sasha/src/bk/mysql-4.0 sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_load.cc: Auto merged
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/union.result60
-rw-r--r--mysql-test/r/unions_one.result15
-rw-r--r--mysql-test/t/analyse.test1
-rw-r--r--mysql-test/t/union.test29
-rw-r--r--mysql-test/t/unions_one.test16
5 files changed, 90 insertions, 31 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
new file mode 100644
index 00000000000..a25ea3f4dcd
--- /dev/null
+++ b/mysql-test/r/union.result
@@ -0,0 +1,60 @@
+a b
+1 a
+2 b
+3 c
+4 d
+5 f
+6 e
+a b
+1 a
+2 b
+3 c
+3 c
+3 c
+4 d
+5 f
+6 e
+a b
+1 a
+2 b
+3 c
+3 c
+3 c
+4 d
+6 e
+5 f
+a b
+1 a
+2 b
+3 c
+3 c
+3 c
+4 d
+5 f
+6 e
+7 g
+0 #
+0 #
+1 a
+2 b
+3 c
+3 c
+3 c
+4 d
+5 f
+6 e
+7 g
+a b
+1 a
+2 b
+3 c
+t1 b count(*)
+t1 a 1
+t1 b 1
+t1 c 2
+t2 c 1
+t2 d 1
+t2 e 1
+t2 f 1
+table type possible_keys key key_len ref rows Extra
+t2 ALL NULL NULL NULL NULL 4
diff --git a/mysql-test/r/unions_one.result b/mysql-test/r/unions_one.result
deleted file mode 100644
index 66cffd9aec1..00000000000
--- a/mysql-test/r/unions_one.result
+++ /dev/null
@@ -1,15 +0,0 @@
-a b
-1 a
-2 b
-3 c
-4 d
-5 e
-6 f
-a b
-1 a
-2 b
-3 c
-3 c
-4 d
-5 e
-6 f
diff --git a/mysql-test/t/analyse.test b/mysql-test/t/analyse.test
index 1b5022f6e4c..3f56b3e47ce 100644
--- a/mysql-test/t/analyse.test
+++ b/mysql-test/t/analyse.test
@@ -2,6 +2,7 @@
# Test of procedure analyse
#
+drop table if exists t1,t2;
create table t1 (i int, j int);
insert into t1 values (1,2), (3,4), (5,6), (7,8);
select * from t1 procedure analyse();
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
new file mode 100644
index 00000000000..b831be7db28
--- /dev/null
+++ b/mysql-test/t/union.test
@@ -0,0 +1,29 @@
+#
+# Test of unions
+#
+
+drop table if exists t1,t2;
+CREATE TABLE t1 (a int not null, b char (10) not null);
+insert into t1 values(1,'a'),(2,'b'),(3,'c'),(3,'c');
+CREATE TABLE t2 (a int not null, b char (10) not null);
+insert into t2 values (3,'c'),(4,'d'),(5,'f'),(6,'e');
+
+select a,b from t1 union select a,b from t2;
+select a,b from t1 union all select a,b from t2;
+select a,b from t1 union all select a,b from t2 order by b;
+select a,b from t1 union all select a,b from t2 union select 7,'g';
+select 0,'#' union select a,b from t1 union all select a,b from t2 union select 7,'gg';
+select a,b from t1 union select a,b from t1;
+select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 group by b;
+
+explain select a,b from t1 union all select a,b from t2;
+
+# Test some error conditions with UNION
+--error 1213
+select a,b from t1 into outfile 'skr' union select a,b from t2;
+--error 1213
+select a,b from t1 order by a union select a,b from t2;
+--error 1214
+select a,b from t1 union select a from t2;
+
+drop table t1,t2;
diff --git a/mysql-test/t/unions_one.test b/mysql-test/t/unions_one.test
deleted file mode 100644
index 54ade3aa453..00000000000
--- a/mysql-test/t/unions_one.test
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# Test of unions
-#
-
-drop table if exists t1,t2;
-CREATE TABLE t1 (a int not null, b char (10) not null);
-insert into t1 values(1,"a"),(2,"b"),(3,"c");
-CREATE TABLE t2 (a int not null, b char (10) not null);
-insert into t2 values (3,"c"),(4,"d"),(5,"e"),(6,"f");
-
-
-select a,b from t1 union select a,b from t2;
-
-select a,b from t1 union all select a,b from t2;
-
-drop table t1,t2;