summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-08-02 21:26:16 +0200
committerSergei Golubchik <sergii@pisem.net>2014-08-02 21:26:16 +0200
commit1c6ad62a269a3a03d8a343e1412876e04e9e9c37 (patch)
tree1e837eb728452ebaf749b5f9eedc018404798ed6 /mysql-test/t/union.test
parent14200dfa43756a0f9cb50c0b5d47d99b4fb1b6fa (diff)
parente9b2f5bf15281583b38a56b12f9ae2420c46a6d1 (diff)
downloadmariadb-git-1c6ad62a269a3a03d8a343e1412876e04e9e9c37.tar.gz
mysql-5.5.39 merge
~40% bugfixed(*) applied ~40$ bugfixed reverted (incorrect or we're not buggy) ~20% bugfixed applied, despite us being not buggy (*) only changes in the server code, e.g. not cmakefiles
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 877509a9fc0..a5d7dae606f 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -1273,6 +1273,36 @@ SELECT(SELECT 1 AS a ORDER BY a) AS dev;
SELECT(SELECT 1 AS a LIMIT 1) AS dev;
SELECT(SELECT 1 AS a FROM dual ORDER BY a DESC LIMIT 1) AS dev;
+
+--echo #
+--echo # Bug #17059925 : UNIONS COMPUTES ROWS_EXAMINED INCORRECTLY
+--echo #
+
+## Save current state of slow log variables
+SET @old_slow_query_log= @@global.slow_query_log;
+SET @old_log_output= @@global.log_output;
+SET @old_long_query_time= @@long_query_time;
+SET GLOBAL log_output= "TABLE";
+SET GLOBAL slow_query_log= ON;
+SET SESSION long_query_time= 0;
+
+CREATE TABLE t17059925 (a INT);
+CREATE TABLE t2 (b INT);
+CREATE TABLE t3 (c INT);
+INSERT INTO t17059925 VALUES (1), (2), (3);
+INSERT INTO t2 VALUES (4), (5), (6);
+INSERT INTO t3 VALUES (7), (8), (9);
+TRUNCATE table mysql.slow_log;
+--sorted_result
+SELECT * FROM t17059925 UNION SELECT * FROM t2 UNION SELECT * FROM t3;
+SELECT sql_text, rows_examined FROM mysql.slow_log WHERE sql_text LIKE '%SELECT%t17059925%';
+DROP TABLE t17059925, t2, t3;
+
+## Reset to initial values
+SET @@long_query_time= @old_long_query_time;
+SET @@global.log_output= @old_log_output;
+SET @@global.slow_query_log= @old_slow_query_log;
+
--echo #
--echo # lp:1010729: Unexpected syntax error from UNION
--echo # (bug #54382) with single-table join nest