diff options
author | unknown <pem@mysql.comhem.se> | 2004-05-19 14:51:41 +0200 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2004-05-19 14:51:41 +0200 |
commit | de2c35230fc68eebcbe64e8e629195f1c4d9e76a (patch) | |
tree | 6c3a93862047abb51aa79069335e8eca2e6cbba3 /sql/sql_yacc.yy | |
parent | c907e6fd5c8a5b280c40ca3c72a25199a3394691 (diff) | |
download | mariadb-git-de2c35230fc68eebcbe64e8e629195f1c4d9e76a.tar.gz |
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).
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d7ef1fc8d7f..45e8e6e67e2 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1153,7 +1153,6 @@ merge_insert_types: opt_select_from: opt_limit_clause {} - | FROM DUAL_SYM {} | select_from select_lock_type; udf_func_type: @@ -2296,17 +2295,19 @@ select_part2: select_into: 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 | select_from | into select_from | select_from into; 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: /* empty*/ @@ -4929,7 +4930,6 @@ keyword: | DIRECTORY_SYM {} | DISCARD {} | DO_SYM {} - | DUAL_SYM {} | DUMPFILE {} | DUPLICATE_SYM {} | DYNAMIC_SYM {} |