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

SQL grammar exception on MySQL ALTER statements with multiple columns

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • 2.3.0.Final
    • 2.2.1.Final
    • jdbc-connector
    • None

      Hi, I've been using the Debezium Connector JDBC to stream data into a target MySQL 8 database. However, the generated ALTER statements will have syntax errors when multiple columns are involved. Based on the source code, the MySqlDatabaseDialect class does not override the getAlterTableStatement method of the GeneralDatabaseDialect class, and therefore, the delimiter used is a space. In MySQL, the delimiter required is a comma, see https://dev.mysql.com/doc/refman/8.0/en/alter-table.html.

       

      Sample exception

      Caused by: jakarta.persistence.PersistenceException: Converting org.hibernate.exception.SQLGrammarException to JPA PersistenceException : JDBC exception executing SQL [ALTER TABLE sys_filter ADD accessid integer NULL ADD seqno integer DEFAULT 0 NULL ADD groupid integer DEFAULT 0 NULL ADD header varchar(50) NULL ADD label varchar(100) NULL ADD window varchar(50) NULL] 

       

      This is my first time reporting an issue, and as a developer, I can attempt to work on it.

            Unassigned Unassigned
            cjmencias Christian Jacob Mencias (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: