Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
sql_yacc.yy has this grammar:
join_table:
|
...
|
| table_ref NATURAL inner_join table_factor
|
| table_ref LEFT opt_outer JOIN_SYM table_factor USING ...
|
| table_ref NATURAL LEFT opt_outer JOIN_SYM table_factor
|
| table_ref RIGHT opt_outer JOIN_SYM table_factor USING ...
|
| table_ref NATURAL RIGHT opt_outer JOIN_SYM table_factor ...
|
table_factor:
|
table_ident opt_use_partition opt_table_alias opt_key_definition
|
| select_derived_init get_select_lex select_derived2
|
| '('opt_with_clause get_select_lex select_derived_union ')' opt_table_alias
|
The branch in table_factor that starts with "select_derived" represents a non-parenthesized SELECT query and cannot appear in the rights side of "join_table". For example, this query is syntactically incorrect:
SELECT * FROM t1 NATURAL JOIN SELECT * FROM t2; |
There must be parentheses around the right SELECT.
Under term of this task we'll remove the impossible part from table_factor.
Attachments
Issue Links
- blocks
-
MDEV-8909 union parser cleanup
- Closed