Commit 692c9231 authored by unknown's avatar unknown

Fixed BUG#3709: SELECT INTO 1 FROM DUAL not parsed as expected

Made the combination of INTO and FROM DUAL work, e.g.
SELECT 1 INTO @x FROM DUAL.
As a consequence, DUAL is made a reserved word. It would work to not have
it reserved, but it was deemed to be confusing as a user defined table by
the same name then must be qualified with a db (schema).


sql/sql_yacc.yy:
  Made the combination of INTO and FROM DUAL work, e.g.
  SELECT 1 INTO @x FROM DUAL.
  As a consequence, DUAL is made a reserved word. It would work to not have
  it reserved, but it was deemed to be confusing as a user defined table by
  the same name then must be qualified with a db (schema).
parent c0605f5d
...@@ -1153,7 +1153,6 @@ merge_insert_types: ...@@ -1153,7 +1153,6 @@ merge_insert_types:
opt_select_from: opt_select_from:
opt_limit_clause {} opt_limit_clause {}
| FROM DUAL_SYM {}
| select_from select_lock_type; | select_from select_lock_type;
udf_func_type: udf_func_type:
...@@ -2296,17 +2295,19 @@ select_part2: ...@@ -2296,17 +2295,19 @@ select_part2:
select_into: select_into:
opt_limit_clause {} opt_limit_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 :) */
| into | into
| select_from | select_from
| into select_from | into select_from
| select_from into; | select_from into;
select_from: select_from:
FROM join_table_list where_clause group_clause having_clause opt_order_clause opt_limit_clause procedure_clause; 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 :) */
;
select_options: select_options:
/* empty*/ /* empty*/
...@@ -4929,7 +4930,6 @@ keyword: ...@@ -4929,7 +4930,6 @@ keyword:
| DIRECTORY_SYM {} | DIRECTORY_SYM {}
| DISCARD {} | DISCARD {}
| DO_SYM {} | DO_SYM {}
| DUAL_SYM {}
| DUMPFILE {} | DUMPFILE {}
| DUPLICATE_SYM {} | DUPLICATE_SYM {}
| DYNAMIC_SYM {} | DYNAMIC_SYM {}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment