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

Wrong result when using DATE+INTERVAL arithmetics

    Details

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

      Description

      Test: date '2014-06-19' + interval '1' year

      java.lang.AssertionError: 
      Expected :[2015-06-19]
      Actual   :[2014-06-31]
      

      Generated java code:

      /*  23 */  public Object current() {
      /*  24 */    return $L4J$C$16240_12;
      /*  25 */  }
      /*  26 */ 
      /*  27 */  static final int $L4J$C$16240_12 = 16240 + 12; // !!!  interval '1' year is converted to 12 months and 12 gets added to the number of days
      

      Additional test – JdbcTest.testWinIntervalFrame

        Issue Links

          Activity

          Show
          julianhyde Julian Hyde added a comment - - edited Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/5511253b .
          Hide
          jcamachorodriguez Jesus Camacho Rodriguez added a comment -

          Resolved in release 1.9.0 (2016-09-22)

          Show
          jcamachorodriguez Jesus Camacho Rodriguez added a comment - Resolved in release 1.9.0 (2016-09-22)

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              vladimirsitnikov Vladimir Sitnikov
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development