summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/truncate.result6
-rw-r--r--mysql-test/r/union.result7
-rw-r--r--mysql-test/t/truncate.test5
-rw-r--r--mysql-test/t/union.test3
4 files changed, 20 insertions, 1 deletions
diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result
index 79471611638..e02797cc8e5 100644
--- a/mysql-test/r/truncate.result
+++ b/mysql-test/r/truncate.result
@@ -14,3 +14,9 @@ a b c1
drop table t1;
select count(*) from t1;
Table 'test.t1' doesn't exist
+create temporary table t1 (n int);
+insert into t1 values (1),(2),(3);
+truncate table t1;
+select * from t1;
+n
+drop table t1;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 76f09d6b330..7d914d029af 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -89,6 +89,13 @@ table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
t2 ALL NULL NULL NULL NULL 4 Using filesort
t1 ALL NULL NULL NULL NULL 4
+(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
+a b
+1 a
+2 b
+select found_rows();
+FOUND_ROWS()
+6
explain select a,b from t1 union all select a,b from t2;
table type possible_keys key key_len ref rows Extra
t1 ALL NULL NULL NULL NULL 4
diff --git a/mysql-test/t/truncate.test b/mysql-test/t/truncate.test
index 2430682a93f..1729ddc586a 100644
--- a/mysql-test/t/truncate.test
+++ b/mysql-test/t/truncate.test
@@ -13,3 +13,8 @@ drop table t1;
# The following should fail
--error 1146
select count(*) from t1;
+create temporary table t1 (n int);
+insert into t1 values (1),(2),(3);
+truncate table t1;
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index e62ca6d2700..f5a92b05e0d 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -21,7 +21,8 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1);
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
explain (select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
-
+(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
+select found_rows();
# Test some error conditions with UNION
explain select a,b from t1 union all select a,b from t2;