canal: fix ignore_tables separator and accept quoted identifiers#1145
canal: fix ignore_tables separator and accept quoted identifiers#1145dveeden wants to merge 4 commits into
Conversation
The DumpConfig.IgnoreTables docs say entries use the form db.table, but the parser split on "," instead of ".", so the setting never took effect. Parse entries with a small MySQL identifier parser so the documented db.table form works, along with backtick-quoted identifiers like `db`.`table` that may contain dots or other special characters. Fixes go-mysql-org#1143 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request enhances the parsing of the IgnoreTables configuration by introducing a more robust parser that supports MySQL-quoted identifiers, including backticks and escaped backticks. It replaces the previous comma-based splitting with dedicated splitDBTable and parseIdent functions and adds comprehensive unit tests. Review feedback suggests logging a warning when configuration entries fail to parse to improve observability and recommends optimizing strings.Builder usage by pre-allocating memory to reduce allocations during identifier reconstruction.
|
@gemini could you review again? |
There was a problem hiding this comment.
Code Review
This pull request enhances the ignored tables parsing logic to support MySQL-style backtick-quoted identifiers, replacing the previous comma-based split. It introduces robust parsing functions and corresponding unit tests to handle various identifier formats, including escaped backticks and Unicode characters. The feedback suggests using the configured logger instance rather than the global logger for reporting parsing errors to maintain consistency with the application's logging configuration.
The DumpConfig.IgnoreTables docs say entries use the form db.table, but the parser split on "," instead of ".", so the setting never took effect. Parse entries with a small MySQL identifier parser so the documented db.table form works, along with backtick-quoted identifiers like
db.tablethat may contain dots or other special characters.Fixes #1143