Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10078

sql_yacc.yy: Remove non-parenthesized SELECT from table_factor

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 10.2.1
    • Component/s: Parser
    • Labels:
      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

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: