1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for BUG#8023.

Allow LIMIT clause after DUAL.


mysql-test/r/limit.result:
  Added test result for BUG#8023.
mysql-test/t/limit.test:
  Added test for BUG#8023.
sql/sql_yacc.yy:
  Allow the specification of a LIMIT clause after DUAL. This is needed for queries as:
  select a from t1 union all select 1 from dual limit 1;
  In this query LIMIT is applied to the whole UNION, so it makes sense, however, the
  current parser did not allow any clause after DUAL.
This commit is contained in:
unknown
2005-02-02 08:38:24 +02:00
parent 514b2364b4
commit d81a0bede2
3 changed files with 24 additions and 4 deletions

View File

@ -67,3 +67,12 @@ SELECT * FROM t1;
id id2
3 0
DROP TABLE t1;
create table t1 (a integer);
insert into t1 values (1);
select 1 as a from t1 union all select 1 from dual limit 1;
a
1
(select 1 as a from t1) union all (select 1 from dual) limit 1;
a
1
drop table t1;