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

sql_yacc.yy: get rid of the rules "opt_if_not_exists_table_element" and "opt_if_exists_table_element"

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Fix Version/s: 10.2
    • Component/s: None
    • Labels:
      None

      Description

      This is a clean-up task that can be easily done after MDEV-8093.

      There are two pairs of very similar rules:

      • opt_if_exists vs opt_if_exists_table_element
      • opt_if_not_exists vs opt_if_not_exists_table_element

      which all handle IF EXISTS and IF NOT EXISTS clauses.

      The "opt_if_xxx_table_element" rules use Lex->check_exists as a storage and are used in column and key context of ALTER TABLE:

      ALTER TABLE t1 DROP INDEX IF EXISTS f1;
      

      The "opt_if_xxx" rules are based on DDL_options_st and used in a schema object context:

      CREATE TABLE IF NOT EXISTS t1 (a int);
      DROP FUNCTION IF EXISTS f1;
      

      We'll modify sql_yacc.yy to use the DDL_options_st based rules in all contexts and will get rid of:

      • The "opt_if_exists_table_element" rule
      • The "opt_if_not_exists_table_element" rule
      • The "check_exists" member in LEX.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              There are no comments yet on this issue.

                People

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

                  Dates

                  • Created:
                    Updated: