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

Use date format model that does not depend on client NLS settings in integration tests

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 1.6.0.Beta1
    • 1.5.0.Final
    • oracle-connector
    • None
    • False
    • False
    • Undefined

      Various integration tests in the oracle connector are failing when they are run by a client with a language setting other than english.
      The NLS settings of the connecting session is determined by the clients language setting.  Some format elements (e.g. MON) translate to different values depending on the NLS settings.

      For example, the following function call in SQL will throw an exception (ORA-01858) if the language of the session does not know a month MAR

       

      TO_DATE('27-MAR-2018', 'dd-MON-yyyy')

       

      For all dates literals in SQL statements I therefore suggest to use the ANSI format yyyy-mm-dd. In fact it would be even possible to use the shorter ANSI date literal in a lot of situations (e.g. DATE'2018-03-27' instead of TO_DATE('2018-03-27', 'yyyy-mm-dd'), but to be consistent in the whole code base I think it's probably better to stick to using the TO_DATE function.

              ccranfor@redhat.com Chris Cranford
              taregger Thomas Aregger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: