debezium icon indicating copy to clipboard operation
debezium copied to clipboard

DBZ-8170 Error caused by database name containing regular keywords

Open jw-itq opened this issue 1 year ago • 5 comments

https://issues.redhat.com/browse/DBZ-8170

Error caused by database name containing regular keywords, such as database name: test$user

jw-itq avatar Aug 28 '24 05:08 jw-itq

Welcome as a new contributor to Debezium, @jw-itq. Reviewers, please add missing author name(s) and alias name(s) to the COPYRIGHT.txt and Aliases.txt respectively.

github-actions[bot] avatar Aug 28 '24 05:08 github-actions[bot]

Hi @jw-itq would it be possible to add a test not only for the use case you've described with test$user, but also checking what this change will do should the configuration supply the regular expression contain escaped syntax values, such as test\$user, does this cause such a configuration to no longer work or be interpreted incorrectly?

Naros avatar Aug 29 '24 03:08 Naros

Hi @jw-itq would it be possible to add a test not only for the use case you've described with test$user, but also checking what this change will do should the configuration supply the regular expression contain escaped syntax values, such as test\$user, does this cause such a configuration to no longer work or be interpreted incorrectly?

thanks, I will attempt to add a test case. Yes, this could potentially cause test$user not to be interpreted correctly. However, on the JDBC URL, you cannot use $ but you can use \$. If the Matcher.quoteReplacement is used, test$user will still be effective.

jw-itq avatar Aug 29 '24 06:08 jw-itq

Hi @jw-itq would it be possible to add a test not only for the use case you've described with test$user, but also checking what this change will do should the configuration supply the regular expression contain escaped syntax values, such as test\$user, does this cause such a configuration to no longer work or be interpreted incorrectly?

thanks, I will attempt to add a test case. Yes, this could potentially cause test$user not to be interpreted correctly. However, on the JDBC URL, you cannot use $ but you can use $. If the Matcher.quoteReplacement is used, test$user will still be effective.

But you're also adjusting the Predicates class which is used for many other configuration options such as the include and exclude list configurations that we've always communicated that special regex characters should be escaped if they're part of the database, schema, or table name. So we need to consider all those variants with this change imo.

Naros avatar Aug 29 '24 06:08 Naros

Hi @jw-itq would it be possible to add a test not only for the use case you've described with test$user, but also checking what this change will do should the configuration supply the regular expression contain escaped syntax values, such as test\$user, does this cause such a configuration to no longer work or be interpreted incorrectly?

thanks, I will attempt to add a test case. Yes, this could potentially cause test$user not to be interpreted correctly. However, on the JDBC URL, you cannot use $ but you can use $. If the Matcher.quoteReplacement is used, test$user will still be effective.

But you're also adjusting the Predicates class which is used for many other configuration options such as the include and exclude list configurations that we've always communicated that special regex characters should be escaped if they're part of the database, schema, or table name. So we need to consider all those variants with this change imo.

thanks, the Predicate indeed requires more thought, and I will reconsider the changes regarding the Predicate. Or do you have any better suggestions?

jw-itq avatar Aug 29 '24 06:08 jw-itq