summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2005-01-25 14:30:38 -0800
committerunknown <igor@rurik.mysql.com>2005-01-25 14:30:38 -0800
commit8deafa8037b289d089ffeb8d6bdaee812113a9b0 (patch)
tree7e46acd40fd2b057851a2bab7eb39a56f8ae9fc4 /mysql-test
parentb7c59b9e2266f35dbaa60f8fd2ffa371bbfc46b6 (diff)
downloadmariadb-git-8deafa8037b289d089ffeb8d6bdaee812113a9b0.tar.gz
order_by.result, order_by.test:
Added a test case for bug #7672. sql_yacc.yy: Fixed bug #7672. Made queries of the form (SELECT ...) ORDER BY ... to be equivalent to SELECT ... ORDER BY ... sql/sql_yacc.yy: Fixed bug #7672. Made queries of the form (SELECT ...) ORDER BY ... to be equivalent to SELECT ... ORDER BY ... mysql-test/t/order_by.test: Added a test case for bug #7672. mysql-test/r/order_by.result: Added a test case for bug #7672.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/order_by.result17
-rw-r--r--mysql-test/t/order_by.test13
2 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 859d9d4cab0..4ea638dbc19 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -554,3 +554,20 @@ explain select id,t from t1 force index (primary) order by id;
table type possible_keys key key_len ref rows Extra
t1 index NULL PRIMARY 4 NULL 1000
drop table t1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (2), (1), (1), (2), (1);
+SELECT a FROM t1 ORDER BY a;
+a
+1
+1
+1
+2
+2
+(SELECT a FROM t1) ORDER BY a;
+a
+1
+1
+1
+2
+2
+DROP TABLE t1;
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index 86ecc4aa70d..d65b2c257a1 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -363,4 +363,15 @@ while ($1)
enable_query_log;
explain select id,t from t1 order by id;
explain select id,t from t1 force index (primary) order by id;
-drop table t1; \ No newline at end of file
+drop table t1;
+
+#
+# Bug #7672 - a wrong result for a select query in braces followed by order by
+#
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (2), (1), (1), (2), (1);
+SELECT a FROM t1 ORDER BY a;
+(SELECT a FROM t1) ORDER BY a;
+DROP TABLE t1;
+