Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-8066

ParsingException (MySQL/MariaDB): rename table syntax

XMLWordPrintable

    • Low

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      Debezium 2.6.1.Final

      What is the connector configuration?

      N/A

      What is the captured database version and mode of deployment?

      Amazon RDS for MariaDB 10.5

      What behavior do you expect?

      The following statement should be successfully parsed:

       

      RENAME TABLE IF EXISTS EMPLOYEE TO employee;

       

      This is a valid statement in MariaDB and but not in MySQL:

      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 5
      Server version: 10.5.23-MariaDB-1:10.5.23+maria~ubu2004 mariadb.org binary distributionCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 
      
      MariaDB [mysql]> create table EMPLOYEE (id INT PRIMARY KEY);
      Query OK, 0 rows affected (0.015 sec)
      
      MariaDB [mysql]> RENAME TABLE IF EXISTS EMPLOYEE TO employee;
      Query OK, 0 rows affected (0.006 sec)
      Welcome to the MySQL monitor.  Commands end with ; or \g.
      Your MySQL connection id is 8
      Server version: 8.0.32 MySQL Community Server - GPLCopyright (c) 2000, 2023, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or its
      affiliates. Other names may be trademarks of their respective
      owners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
      
      mysql> create table EMPLOYEE (id INT PRIMARY KEY);
      
      mysql> RENAME TABLE IF EXISTS EMPLOYEE TO employee;
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF EXISTS EMPLOYEE TO employee' at line 1

      What behavior do you see?

      [Worker-0b0fde2bc326c9795] io.debezium.text.ParsingException: DDL statement couldn't be parsed. Please open a Jira issue with the statement 'RENAME TABLES IF EXISTS EMPLOYEE_TEAMS_HIERARCHY_UPDATES to employee_teams_hierarchy_updates, DEPARTMENTS_HIERARCHY_UPDATES to departments_hierarchy_updates'
      [Worker-0b0fde2bc326c9795] no viable alternative at input 'RENAME TABLES'

      Do you see the same behaviour using the latest released Debezium version?

      Yes, issue also exists on latest main branch.

              Unassigned Unassigned
              pricelessjunk kaustuv Chakrabarti (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: