Derby
  1. Derby
  2. DERBY-1869

lang/timestampArith.java fails if it starts right before midnight

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 10.0.2.1
    • Fix Version/s: 10.3.1.4
    • Component/s: Test
    • Labels:
      None
    • Bug behavior facts:
      Regression Test Failure

      Description

      If lang/timestampArith.java is started right before midnight, it might fail because timestamps that should have had the same date, get different dates.

                      • Diff file derbyall/derbylang/timestampArith.diff
          • Start: timestampArith jdk1.5.0_04 derbyall:derbylang 2006-09-12 23:59:52 ***
            2 del
            < PASSED.
            2 add
            > Unexpected exception from Statement 'values(
            Unknown macro: {fn TIMESTAMPDIFF( SQL_TSI_FRAC_SECOND, {ts 'xxxxxxFILTERED-TIMESTAMPxxxxx'},{t '10:00:00'})}

            )'
            > Unexpected exception:
            > The resulting value is outside the range for the data type INTEGER.
            > ERROR 22003: The resulting value is outside the range for the data type INTEGER.
            ....

      1. 1869.diff
        0.8 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        The test already has code to prevent it from being run too close to midnight. The code checks whether the time is 23:58, and if it is, waits until it is 23:59. This is obviously not correct. The attached patch changes the test so that it waits until it is past midnight if the time is more than 23:58.

        Show
        Knut Anders Hatlen added a comment - The test already has code to prevent it from being run too close to midnight. The code checks whether the time is 23:58, and if it is, waits until it is 23:59. This is obviously not correct. The attached patch changes the test so that it waits until it is past midnight if the time is more than 23:58.
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 448133.

        Show
        Knut Anders Hatlen added a comment - Committed revision 448133.

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development