[ 
https://issues.apache.org/jira/browse/CALCITE-308?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde resolved CALCITE-308.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 1.9.0

Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/29f518f0.

> Wrong result when using DATE+INTERVAL arithmetics
> -------------------------------------------------
>
>                 Key: CALCITE-308
>                 URL: https://issues.apache.org/jira/browse/CALCITE-308
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Vladimir Sitnikov
>            Assignee: Julian Hyde
>             Fix For: 1.9.0
>
>
> Test: {{date '2014-06-19' + interval '1' year}}
> {noformat}
> java.lang.AssertionError: 
> Expected :[2015-06-19]
> Actual   :[2014-06-31]
> {noformat}
> Generated java code:
> {noformat}
> /*  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
> {noformat}
> Additional test -- {{JdbcTest.testWinIntervalFrame}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to