Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5538

TimestampString should allow fractional seconds ending in zero

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.33.0
    • 1.35.0
    • core
    • None

    Description

      The root cause is that the TimestampString constructor validates a string argument with the following regular expression: ??"[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"
                + " "
                + "[0-9][0-9]:[0-9][0-9]:[0-9][0-9](.[0-9]*[1-9])?"??

      Unfortunately this rejects perfectly legal timestamp strings such as "2023-02-21 10:10:10.000".

      The fix is trivial, if we agree that this is a bug. Is there a deeper reason for this validation?

      There seem to be no unit tests for this TimestampString constructor.

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              mbudiu Mihai Budiu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: