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

Database case sensitivity can lead to NullPointerException on column lookups

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.7.0.Final
    • 2.6.2.Final
    • jdbc-connector
    • None

      When generating change events with fields that use camel case and writing the data to a target database that automatically lowers or upper cases columns like PostgreSQL or Oracle, there are situations where the lack of setting quote.identifiers to true can lead to NullPointerExceptions, such as this specific code:

      https://github.com/debezium/debezium-connector-jdbc/blob/3ecbf31ead76c036d7d16e91811e337171a864cb/src/main/java/io/debezium/connector/jdbc/dialect/GeneralDatabaseDialect.java#L767-L771

      We should ideally guard against NPE and instead validate the ColumnDescriptor, throwing an exception. For example in this case:

      Column 'ParamValue' was not found in table 'test_testdb_dbo_MTConfig'. Perhaps consider reviewing whether you should use 'quote.identifiers' when source and target table/column names differ in case.
      

      See https://debezium.zulipchat.com/#narrow/stream/383534-community-jdbc/topic/.E2.9C.94.20NullPointerException.20for.20a.20sink.20record/near/445112752 discussion for more details.

              ccranfor@redhat.com Chris Cranford
              ccranfor@redhat.com Chris Cranford
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: