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

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: