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

SQL syntax error near '"gtid_purged"'

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 0.9.1.Final
    • Fix Version/s: 0.9.2.Final
    • Component/s: mysql-connector
    • Labels:
      None
    • Environment:

      Docker image debezium/connect:0.9.1.Final running on Ubuntu 18.04.1 LTS in Oracle Virtual VM Box on Windows 10 + mysql with gtid_mode = on and sql-mode="ANSI_QUOTES"

    • Steps to Reproduce:
      Hide
      1. Setup and start a mysql DB with parameters like this:
        [mysqld]
        sql-mode = "ANSI_QUOTES,..."
        gtid_mode = on
        
      2. start debezium connector debezium/connect:0.9.1.Final
      3. configure a connector pointing to mysql DB.
      Show
      Setup and start a mysql DB with parameters like this: [mysqld] sql-mode = "ANSI_QUOTES,..." gtid_mode = on start debezium connector debezium/connect:0.9.1.Final configure a connector pointing to mysql DB.

      Description

      Can't create (configure) a mysql connector with listed DB settings because of SQL syntax errors. Please use single quotations marks here in MySqlJdbcContext.java.

      Console output of issue
      2019-02-15 14:01:40,414 INFO   ||  WorkerSourceTask{id=eventconnector-0} Committing offsets   [org.apache.kafka.connect.runtime.WorkerSourceTask]
      2019-02-15 14:01:40,414 INFO   ||  WorkerSourceTask{id=eventconnector-0} flushing 0 outstanding messages for offset commit   [org.apache.kafka.connect.runtime.WorkerSourceTask]
      2019-02-15 14:01:40,415 ERROR  ||  WorkerSourceTask{id=eventconnector-0} Task threw an uncaught and unrecoverable exception   [org.apache.kafka.connect.runtime.WorkerTask]
      org.apache.kafka.connect.errors.ConnectException: Unexpected error while connecting to MySQL and looking at gtid_purged variable: 
      	at io.debezium.connector.mysql.MySqlJdbcContext.purgedGtidSet(MySqlJdbcContext.java:215)
      	at io.debezium.connector.mysql.BinlogReader.doStart(BinlogReader.java:298)
      	at io.debezium.connector.mysql.AbstractReader.start(AbstractReader.java:116)
      	at io.debezium.connector.mysql.ChainedReader.startNextReader(ChainedReader.java:203)
      	at io.debezium.connector.mysql.ChainedReader.start(ChainedReader.java:103)
      	at io.debezium.connector.mysql.MySqlConnectorTask.start(MySqlConnectorTask.java:256)
      	at io.debezium.connector.common.BaseSourceTask.start(BaseSourceTask.java:47)
      	at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:198)
      	at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)
      	at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.sql.SQLSyntaxErrorException: 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 '"gtid_purged"' at line 1
      	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
      	at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
      	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
      	at com.mysql.cj.jdbc.StatementImpl.executeQuery(StatementImpl.java:1218)
      	at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:434)
      	at io.debezium.jdbc.JdbcConnection.query(JdbcConnection.java:377)
      	at io.debezium.connector.mysql.MySqlJdbcContext.purgedGtidSet(MySqlJdbcContext.java:208)
      	... 14 more
      2019-02-15 14:01:40,430 ERROR  ||  WorkerSourceTask{id=eventconnector-0} Task is being killed and will not recover until manually restarted   [org.apache.kafka.connect.runtime.WorkerTask]
      2019-02-15 14:01:40,430 INFO   MySQL|rdb|task  Stopping MySQL connector task   [io.debezium.connector.mysql.MySqlConnectorTask]
      2019-02-15 14:01:40,430 INFO   ||  [Producer clientId=producer-4] Closing the Kafka producer with timeoutMillis = 30000 ms.   [org.apache.kafka.clients.producer.KafkaProducer]
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                jpechanec Jiri Pechanec
                Reporter:
                DetlefPumpenschnabel Detlef Pumpenschnabel
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: