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

MySQL DDL parser - issue with COLLATE in functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.10.0.Beta2
    • 0.9.4.Final
    • mysql-connector
    • None

      After fixing the issue DBZ-1331 my debezium process stopped on parsing function definition. It looks the Antlr grammar was not able to parse function that returns string with custom collation, like:

      CREATE FUNCTION `func1`() RETURNS varchar(5) CHARSET utf8 COLLATE utf8_unicode_ci BEGIN 
        return '12345'; 
      END;
      

      But function like this is proper MySQL function (I tested it on MariaDB, but according to the docs it should work as well in MySQL):

      MariaDB [superset]> delimiter //
      MariaDB [superset]> CREATE FUNCTION `func1`() RETURNS varchar(5) CHARSET utf8 COLLATE utf8_unicode_ci begin return '12345'; end;
          -> //
      Query OK, 0 rows affected (0.03 sec)
      
      MariaDB [superset]> delimiter ;
      MariaDB [superset]> select func1()
          -> ;
      +---------+
      | func1() |
      +---------+
      | 12345   |
      +---------+
      1 row in set (0.00 sec)
      

      I'm going to attach the pull request in a few minutes

              Unassigned Unassigned
              szczeles Mariusz Strzelecki (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: