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

Exception when parsing enum field with escaped characters values

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.7.0
    • 0.6.2
    • mysql-connector
    • None
    • Hide

      Create this table:
      CREATE TABLE `filters` (
      `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
      `operator` enum('=','>','<','>=','<=','!=','LIKE ''%$%''') DEFAULT NULL,
      `value` varchar(255) DEFAULT NULL,
      PRIMARY KEY (`id`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8

      And run debezium job against it

      Show
      Create this table: CREATE TABLE `filters` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `operator` enum('=','>','<','>=','<=','!=','LIKE ''%$%''') DEFAULT NULL, `value` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 And run debezium job against it

      Debezium snapshotting breaks if mysql database contains enum with string value that has escaped quotation marks in it. Like 'hel''lo'.

      The exception is:
      2017-11-21 09:11:08,671 ERROR MySQL|db123|binlog Failed due to error: Error processing binlog event [io.debezium.connector.mysql.BinlogReader]
      org.apache.kafka.connect.errors.ConnectException: Expecting ')' at line 1, column 40 but found ''%$%'': =','<=','!=','LIKE ' ===>> '%$%''','LIKE ''$%''

      All valid mysql escaping cases listed here:
      https://dev.mysql.com/doc/refman/5.7/en/string-literals.html

            jpechane Jiri Pechanec
            pimpelsang Eero Koplimets (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: