summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <Sinisa@sinisa.nasamreza.org>2005-05-18 19:43:48 +0300
committerunknown <Sinisa@sinisa.nasamreza.org>2005-05-18 19:43:48 +0300
commita217404883825b5f676ab27d39980345d5ae667b (patch)
tree4eb5ef875f4e3c7b53695ff7380e98099575db78
parent0a2b07254f85b9e3a1a5a4bc52bb44957006cc31 (diff)
parent2f9c6377f02f9499115f40eceaf8a5247a742068 (diff)
downloadmariadb-git-a217404883825b5f676ab27d39980345d5ae667b.tar.gz
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1
-rw-r--r--mysql-test/r/union.result19
-rw-r--r--mysql-test/t/union.test11
-rw-r--r--sql/sql_yacc.yy2
3 files changed, 31 insertions, 1 deletions
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index c140ecd26e1..b315ae9a3f5 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1235,3 +1235,22 @@ show columns from t2;
Field Type Null Key Default Extra
a varchar(3) YES NULL
drop table t2, t1;
+create table t1 ( id int not null auto_increment, primary key (id), col1 int);
+insert into t1 (col1) values (2),(3),(4),(5),(6);
+select 99 union all select id from t1 order by 1;
+99
+1
+2
+3
+4
+5
+99
+select id from t1 union all select 99 order by 1;
+id
+1
+2
+3
+4
+5
+99
+drop table t1;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index b0446e1ea4a..ecd98428b5a 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -742,3 +742,14 @@ create table t2 select a from t1 union select c from t1;
create table t2 select a from t1 union select b from t1;
show columns from t2;
drop table t2, t1;
+
+
+#
+# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
+#
+
+create table t1 ( id int not null auto_increment, primary key (id), col1 int);
+insert into t1 (col1) values (2),(3),(4),(5),(6);
+select 99 union all select id from t1 order by 1;
+select id from t1 union all select 99 order by 1;
+drop table t1;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 2edad446499..d8a2c997bf8 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2449,7 +2449,7 @@ select_part2:
select_into select_lock_type;
select_into:
- opt_limit_clause {}
+ opt_order_clause opt_limit_clause {}
| into
| select_from
| into select_from