hongbin ma created CALCITE-1639:
-----------------------------------

             Summary: issue for timestampadd month
                 Key: CALCITE-1639
                 URL: https://issues.apache.org/jira/browse/CALCITE-1639
             Project: Calcite
          Issue Type: Bug
            Reporter: hongbin ma
            Assignee: Julian Hyde


in calcite, 

select timestampadd(MONTH,1,cast('2016-05-31' as timestamp))  will return 
2016-07-01 00:00:00, and select timestampadd(MONTH,-1,cast('2016-03-31' as 
timestamp))  will return 2016-03-01 00:00:00

however in mysql, the last day of the next/previous month is always returned:

mysql> select timestampadd(MONTH,1,'2016-05-31') ;
+------------------------------------+
| timestampadd(MONTH,1,'2016-05-31') |
+------------------------------------+
| 2016-06-30                         |
+------------------------------------+
1 row in set (0.00 sec)

mysql> select timestampadd(MONTH,-1,'2016-03-31') ;
+-------------------------------------+
| timestampadd(MONTH,-1,'2016-03-31') |
+-------------------------------------+
| 2016-02-29                          |
+-------------------------------------+
1 row in set (0.00 sec)

mysql> 




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to