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

Wrong result when using DATE+INTERVAL arithmetics

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.9.0
    • None
    • 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

      Attachments

        Issue Links

          Activity

            People

              julianhyde Julian Hyde
              vladimirsitnikov Vladimir Sitnikov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: