diff options
author | unknown <timour@mysql.com> | 2005-02-02 08:38:24 +0200 |
---|---|---|
committer | unknown <timour@mysql.com> | 2005-02-02 08:38:24 +0200 |
commit | d81a0bede23ca74222252b6f43bd85ead5d7be2a (patch) | |
tree | e918a393d7772ab0a299bcc3ea1b6a8756f5ae7f /sql/sql_yacc.yy | |
parent | 514b2364b4156e23fb15f4506a50877011b9c7ef (diff) | |
download | mariadb-git-d81a0bede23ca74222252b6f43bd85ead5d7be2a.tar.gz |
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.
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1e51d8fb82d..e70efe14557 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2455,10 +2455,11 @@ select_into: select_from: FROM join_table_list where_clause group_clause having_clause opt_order_clause opt_limit_clause procedure_clause - | FROM DUAL_SYM /* oracle compatibility: oracle always requires FROM - clause, and DUAL is system table without fields. - Is "SELECT 1 FROM DUAL" any better than - "SELECT 1" ? Hmmm :) */ + | FROM DUAL_SYM opt_limit_clause + /* oracle compatibility: oracle always requires FROM clause, + and DUAL is system table without fields. + Is "SELECT 1 FROM DUAL" any better than "SELECT 1" ? + Hmmm :) */ ; select_options: |