summaryrefslogtreecommitdiff
path: root/mysql-test/t/order_by.test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2010-11-23 23:39:59 +0200
committerMichael Widenius <monty@askmonty.org>2010-11-23 23:39:59 +0200
commitb52020221e8b4e58d1bc6dd5a5a6f065a6a3a083 (patch)
tree6068b9d90b4127b1c3608e29913fa82bf1a1f20e /mysql-test/t/order_by.test
parent7840965db9460e2117c163f3db83aaa247c65203 (diff)
parent498ee6bd19eabc85dcbd9abebc9cf6aeb79d1985 (diff)
downloadmariadb-git-b52020221e8b4e58d1bc6dd5a5a6f065a6a3a083.tar.gz
Merge with MySQL 5.1.52
Diffstat (limited to 'mysql-test/t/order_by.test')
-rw-r--r--mysql-test/t/order_by.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index de380e09e8a..0bacd785808 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -1469,4 +1469,29 @@ SELECT * FROM t1 FORCE INDEX FOR JOIN (a), t2 WHERE t1.a < 2 ORDER BY t1.a;
DROP TABLE t1, t2;
+--echo #
+--echo # Bug #50394: Regression in EXPLAIN with index scan, LIMIT, GROUP BY and
+--echo # ORDER BY computed col
+--echo #
+CREATE TABLE t1 ( a INT NOT NULL, b INT NOT NULL, KEY( a, b ) );
+
+INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+INSERT INTO t1 SELECT a + 5, b + 5 FROM t1;
+
+CREATE TABLE t2( a INT PRIMARY KEY, b INT );
+
+INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
+INSERT INTO t2 SELECT a + 5, b + 5 FROM t2;
+
+EXPLAIN
+SELECT count(*) AS c, t1.a
+FROM t1 JOIN t2 ON t1.b = t2.a
+WHERE t2.b = 1
+GROUP BY t1.a
+ORDER by c
+LIMIT 2;
+
+DROP TABLE t1, t2;
+
+
--echo End of 5.1 tests