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

TIMESTAMPADD(MICROSECOND, ...) returns incorrect results

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.17.0
    • Component/s: core
    • Labels:
      None

      Description

      Add this test to SqlOperatorBaseTest#testTimestampAdd :

      tester.checkScalar(
          "timestampadd(MICROSECOND, 2, timestamp '2016-02-24 12:42:25.000000')",
          "2016-02-24 12:42:25.000002",
          "TIMESTAMP(6) NOT NULL");

      SqlTimestampAddFunction has incorrect precision for MILLISECOND and MICROSECOND. Note that the parser does not allow for MILLISECOND as a time unit.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                sudheeshkatkam Sudheesh Katkam
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: