Skip to content

[FLINK-38021] [cdc connector mysql] Support double quotes in MySQL DDL parsing for DEFAULT VALUE and COMMENT#4219

Closed
ThorneANN wants to merge 2 commits into
apache:masterfrom
ThorneANN:FLINK-38021
Closed

[FLINK-38021] [cdc connector mysql] Support double quotes in MySQL DDL parsing for DEFAULT VALUE and COMMENT#4219
ThorneANN wants to merge 2 commits into
apache:masterfrom
ThorneANN:FLINK-38021

Conversation

@ThorneANN
Copy link
Copy Markdown
Contributor

This commit enhances the MySQL CDC connectors to correctly parse DDL statements
containing both single quotes and double quotes in DEFAULT VALUE and COMMENT clauses.

Changes:

  • flink-connector-mysql-cdc: Updated DefaultValueParserListener.unquote() to handle
    both single and double quotes for DEFAULT VALUE parsing
  • flink-cdc-pipeline-connector-mysql: Added MySqlSchemaUtils.removeQuotes() utility
    method to handle both quote types for COMMENT parsing
  • Updated CustomColumnDefinitionParserListener and CustomAlterTableParserListener
    to use the new removeQuotes() method

Tests:

  • Added DefaultValueParserListenerTest with 5 unit tests
  • Added MySqlSchemaUtilsTest with 7 unit tests
  • Added MySqlCommentParsingITCase with 4 integration tests

This change ensures robust parsing of binlog events that may use either single
or double quotes, as MySQL normalizes double quotes to single quotes in
SHOW CREATE TABLE output but binlog events may contain either type.

Thorne and others added 2 commits January 12, 2026 13:26
…VALUE and COMMENT

This commit enhances the MySQL CDC connectors to correctly parse DDL statements
containing both single quotes and double quotes in DEFAULT VALUE and COMMENT clauses.

Changes:
- flink-connector-mysql-cdc: Updated DefaultValueParserListener.unquote() to handle
  both single and double quotes for DEFAULT VALUE parsing
- flink-cdc-pipeline-connector-mysql: Added MySqlSchemaUtils.removeQuotes() utility
  method to handle both quote types for COMMENT parsing
- Updated CustomColumnDefinitionParserListener and CustomAlterTableParserListener
  to use the new removeQuotes() method

Tests:
- Added DefaultValueParserListenerTest with 5 unit tests
- Added MySqlSchemaUtilsTest with 7 unit tests
- Added MySqlCommentParsingITCase with 4 integration tests

This change ensures robust parsing of binlog events that may use either single
or double quotes, as MySQL normalizes double quotes to single quotes in
SHOW CREATE TABLE output but binlog events may contain either type.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ThorneANN ThorneANN closed this Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant