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

Synchronize ALTER TABLE EXCHANGE PARTITION and PURGE grammar in sql_yacc.yy and sql_yacc_ora.yy

Details

    Description

      ALTER TABLE EXCHANGE PARTITION and PURGE related C++ code blocks have diverged in the two *.yy files.
      Under terms of this task we'll synchronize the code.
      Let's move the C++ code into new LEX methods:

        bool stmt_alter_table_exchange_partition(Table_ident *table);
        void stmt_purge_to(const LEX_CSTRING &to);
        bool stmt_purge_before(Item *item);
      

      The relevant grammar in the new reduction will look like:

      alter_commands:
                ...
              | EXCHANGE_SYM PARTITION_SYM alt_part_name_item
                WITH TABLE_SYM table_ident have_partitioning
                {
                  if (Lex->stmt_alter_table_exchange_partition($6))
                    MYSQL_YYABORT;
                }
              ;
      

      purge:
                PURGE master_or_binary LOGS_SYM TO_SYM TEXT_STRING_sys
                {
                  Lex->stmt_purge_to($5);
                }
              | PURGE master_or_binary LOGS_SYM BEFORE_SYM expr_no_subselect
                {
                  if (Lex->stmt_purge_before($5))
                    MYSQL_YYABORT;
                }
              ;
      

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            Labels Compatibility
            bar Alexander Barkov made changes -
            Description {{ALTER TABLE EXCHANGE PARTITION}} and {{PURGE}} related C++ code blocks have diverged in the two {{*.yy}} files.
            Under terms of this task we'll synchronize the code.
            Let's move the C++ code into new {{LEX}} methods:

            {code:cpp}
              bool stmt_alter_table_exchange_partition(Table_ident *table);
              void stmt_purge_to(const LEX_CSTRING &to);
              bool stmt_purge_before(Item *item);
            {cpp}


            The relevant grammar in the new reduction will look like:
            {code:cpp}
            alter_commands:
                      ...
                    | EXCHANGE_SYM PARTITION_SYM alt_part_name_item
                      WITH TABLE_SYM table_ident have_partitioning
                      {
                        if (Lex->stmt_alter_table_exchange_partition($6))
                          MYSQL_YYABORT;
                      }
                    ;
            {code}

            {code:cpp}
            purge:
                      PURGE master_or_binary LOGS_SYM TO_SYM TEXT_STRING_sys
                      {
                        Lex->stmt_purge_to($5);
                      }
                    | PURGE master_or_binary LOGS_SYM BEFORE_SYM expr_no_subselect
                      {
                        if (Lex->stmt_purge_before($5))
                          MYSQL_YYABORT;
                      }
                    ;
            {code}
            {{ALTER TABLE EXCHANGE PARTITION}} and {{PURGE}} related C++ code blocks have diverged in the two {{*.yy}} files.
            Under terms of this task we'll synchronize the code.
            Let's move the C++ code into new {{LEX}} methods:

            {code:cpp}
              bool stmt_alter_table_exchange_partition(Table_ident *table);
              void stmt_purge_to(const LEX_CSTRING &to);
              bool stmt_purge_before(Item *item);
            {code}


            The relevant grammar in the new reduction will look like:
            {code:cpp}
            alter_commands:
                      ...
                    | EXCHANGE_SYM PARTITION_SYM alt_part_name_item
                      WITH TABLE_SYM table_ident have_partitioning
                      {
                        if (Lex->stmt_alter_table_exchange_partition($6))
                          MYSQL_YYABORT;
                      }
                    ;
            {code}

            {code:cpp}
            purge:
                      PURGE master_or_binary LOGS_SYM TO_SYM TEXT_STRING_sys
                      {
                        Lex->stmt_purge_to($5);
                      }
                    | PURGE master_or_binary LOGS_SYM BEFORE_SYM expr_no_subselect
                      {
                        if (Lex->stmt_purge_before($5))
                          MYSQL_YYABORT;
                      }
                    ;
            {code}
            bar Alexander Barkov made changes -
            issue.field.resolutiondate 2019-03-04 13:08:14.0 2019-03-04 13:08:14.25
            bar Alexander Barkov made changes -
            Fix Version/s 10.4.4 [ 23310 ]
            Fix Version/s 10.4 [ 22408 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 92947 ] MariaDB v4 [ 133882 ]

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.