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

Unable to specify column or table include list if name contains a backslash \

      In order to make your issue reports as actionable as possible, please provide the following information, depending on the issue type.

      Bug report

      For bug reports, provide this information, please:

      What Debezium connector do you use and what version?

      1.9.6

      What is the connector configuration?

      Debezium engine (tested with mysql and postgres)

      What is the captured database version and mode of depoyment?

      Tested with local mysql, postgres

      What behaviour do you expect?

      When a column name or a table name contains a backslash character (e.g "sales\APAC")

      specifying table.include.name or column.include.name make it impossible to read the table or column.

      I cannot find a way to escape a backslash. All other characters I tested with work when escaped, including emojis, different writing systems, crazy unicode characters and also characters which have a meaning for regex such as + * , ().

      for example. Starting the debezlum engine with with escaping.

      table.include.list = \\Qpublic.id_and_name\\E,\\Qpublic.starships\\\\E"}}

      should find the tables "public.id_and_name" and also "public.starships\" (note the backslash after starships).

      In effect only id_and_name table is found.

      What behaviour do you see?

      if using the column and table include/exclude lists with names containing a backslash \, debzium fails to match.

      Do you see the same behaviour using the latest relesead Debezium version?

      (Ideally, also verify with latest Alpha/Beta/CR version)

      <Your answer>

      Do you have the connector logs, ideally from start till finish?

      Didn't check with 2.x

      How to reproduce the issue using our tutorial deployment?

      Create a table whose name contain a "\" and try to include it it table.include.list prop.

      Feature request or enhancement

      For feature requests or enhancements, provide this information, please:

      Which use case/requirement will be addressed by the proposed feature?

      Since backslash is a legal character for postgres, MySQL 

      Implementation ideas (optional)

      I assume that regex matching is handling backslash differently than other characters.

            [DBZ-5917] Unable to specify column or table include list if name contains a backslash \

            Errata Tool added a comment -

            Since the problem described in this issue should be resolved in a recent advisory, it has been closed.

            For information on the advisory (Red Hat build of Debezium 2.3.4 release), and where to find the updated files, follow the link below.

            If the solution does not work for you, open a new bug report.
            https://access.redhat.com/errata/RHEA-2023:5471

            Errata Tool added a comment - Since the problem described in this issue should be resolved in a recent advisory, it has been closed. For information on the advisory (Red Hat build of Debezium 2.3.4 release), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2023:5471

            Released

            Debezium Builder added a comment - Released

            I never had this NPE vjuranek@redhat.com 

            Though in our product we only include. No exclude (and on 1.9.6).

            I will try to apply your patch on 1.9.6 to validate.

            Thank you for working on this! help much appreciated

            Rodi Reich Zilberman (Inactive) added a comment - I never had this NPE vjuranek@redhat.com   Though in our product we only include. No exclude (and on 1.9.6). I will try to apply your patch on 1.9.6 to validate. Thank you for working on this! help much appreciated

            If not sure I was able to reproduce exactly this issue as either everything works for me (case when there is no table excluded) or I'm getting following NPE (in the case when there is one or more excluded tables):

            2023-01-18 08:44:05,769 WARN   Postgres|dbserver1|snapshot  Snapshot was not completed successfully, it will be re-executed upon connector restart   [io.debezium.pipeline.source.AbstractSnapshotChangeEventSource]
            2023-01-18 08:44:05,769 ERROR  Postgres|dbserver1|snapshot  Producer failure   [io.debezium.pipeline.ErrorHandler]
            io.debezium.DebeziumException: java.lang.NullPointerException
                    at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:85)
                    at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:155)
                    at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:137)
                    at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:109)
                    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
                    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
                    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
                    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
                    at java.base/java.lang.Thread.run(Thread.java:829)
            Caused by: java.lang.NullPointerException
                    at io.debezium.relational.RelationalSnapshotChangeEventSource.createDataEventsForTable(RelationalSnapshotChangeEventSource.java:363)
                    at io.debezium.relational.RelationalSnapshotChangeEventSource.createDataEvents(RelationalSnapshotChangeEventSource.java:319)
                    at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:134)
                    at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:76)
                    ... 8 more
            

            This might be caused by the fact the bug was filed for 1.9, while I'm using 2.2.0 snapshot, but in the case the patch which I'm going to post soon doesn't fully fix the issue, please re-open or create new one.

            Vojtech Juranek added a comment - If not sure I was able to reproduce exactly this issue as either everything works for me (case when there is no table excluded) or I'm getting following NPE (in the case when there is one or more excluded tables): 2023-01-18 08:44:05,769 WARN Postgres|dbserver1|snapshot Snapshot was not completed successfully, it will be re-executed upon connector restart [io.debezium.pipeline.source.AbstractSnapshotChangeEventSource] 2023-01-18 08:44:05,769 ERROR Postgres|dbserver1|snapshot Producer failure [io.debezium.pipeline.ErrorHandler] io.debezium.DebeziumException: java.lang.NullPointerException at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:85) at io.debezium.pipeline.ChangeEventSourceCoordinator.doSnapshot(ChangeEventSourceCoordinator.java:155) at io.debezium.pipeline.ChangeEventSourceCoordinator.executeChangeEventSources(ChangeEventSourceCoordinator.java:137) at io.debezium.pipeline.ChangeEventSourceCoordinator.lambda$start$0(ChangeEventSourceCoordinator.java:109) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:829) Caused by: java.lang.NullPointerException at io.debezium.relational.RelationalSnapshotChangeEventSource.createDataEventsForTable(RelationalSnapshotChangeEventSource.java:363) at io.debezium.relational.RelationalSnapshotChangeEventSource.createDataEvents(RelationalSnapshotChangeEventSource.java:319) at io.debezium.relational.RelationalSnapshotChangeEventSource.doExecute(RelationalSnapshotChangeEventSource.java:134) at io.debezium.pipeline.source.AbstractSnapshotChangeEventSource.execute(AbstractSnapshotChangeEventSource.java:76) ... 8 more This might be caused by the fact the bug was filed for 1.9, while I'm using 2.2.0 snapshot, but in the case the patch which I'm going to post soon doesn't fully fix the issue, please re-open or create new one.

            Rodi Reich Zilberman (Inactive) added a comment - Chat thread: https://debezium.zulipchat.com/#narrow/stream/302529-users/topic/escaping.20a.20backslash.20in.20table.2Einclude.2Elist

              vjuranek@redhat.com Vojtech Juranek
              rodirz Rodi Reich Zilberman (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: