[MDEV-18806] Synchronize ALTER TABLE EXCHANGE PARTITION and PURGE grammar in sql_yacc.yy and sql_yacc_ora.yy Created: 2019-03-04  Updated: 2019-03-04  Resolved: 2019-03-04

Status: Closed
Project: MariaDB Server
Component/s: Parser
Fix Version/s: 10.4.4

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: Compatibility

Issue Links:
Blocks
blocks MDEV-18796 Synchronize PS grammar between sql_ya... Closed

 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;
          }
        ;


Generated at Thu Feb 08 08:46:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.