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

TIMESTAMPADD function handles TIME incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.17.0
    • 1.18.0
    • core
    • None

    Description

      Two errors occur when timestampadd(MINUTE, 1, time '01:00:00') is executed:

      1. The return result can only be of TimeStamp type and is expected to be of Time type
      2. The return value is 1970-01-01 01:01:00, and the expectation is 01:01:00
      3. I think it should meet the following conditions:
      expression Expect the result
      timestampadd(MINUTE, -1, time '00:00:00') 23:59:00
      timestampadd(MINUTE, 1, time '00:00:00') 00:01:00
      timestampadd(MINUTE, 1, time '23:59:59') 00:00:59
      timestampadd(SECOND, 1, time '23:59:59') 00:00:00
      timestampadd(HOUR, 1, time '23:59:59') 00:59:59
      timestampadd(DAY, -1, time '23:59:59') 23:59:59
      timestampadd(WEEK, -1, time '23:59:59') 23:59:59
      timestampadd(MONTH, -1, time '23:59:59') 23:59:59
      timestampadd(QUARTER, -1, time '23:59:59') 23:59:59
      timestampadd(YEAR, -1, time '23:59:59') 23:59:59

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            x1q1j1 Forward Xu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: