diff options
author | jimw@mysql.com <> | 2005-10-13 15:32:31 -0700 |
---|---|---|
committer | jimw@mysql.com <> | 2005-10-13 15:32:31 -0700 |
commit | bae115423598ae7019a18cb8a8377987c0faca30 (patch) | |
tree | 74b1654f734a495d34d748769708786579722b51 /mysql-test/t/func_time.test | |
parent | 59e35d6253515f5c0ed3f094c040e832258ce2a4 (diff) | |
download | mariadb-git-bae115423598ae7019a18cb8a8377987c0faca30.tar.gz |
Fix calculation of TIMESTAMPDIFF() of months and years. (Bug #13534)
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r-- | mysql-test/t/func_time.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 3dd7f7276fb..3a2eea59bed 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -404,4 +404,28 @@ delimiter ;// call t_sysdate(); drop procedure t_sysdate; +# +# Bug #13534: timestampdiff() returned incorrect results across leap years +# +select timestampdiff(month,'2004-09-11','2004-09-11'); +select timestampdiff(month,'2004-09-11','2005-09-11'); +select timestampdiff(month,'2004-09-11','2006-09-11'); +select timestampdiff(month,'2004-09-11','2007-09-11'); +select timestampdiff(month,'2005-09-11','2004-09-11'); +select timestampdiff(month,'2005-09-11','2003-09-11'); + +select timestampdiff(month,'2004-02-28','2005-02-28'); +select timestampdiff(month,'2004-02-29','2005-02-28'); +select timestampdiff(month,'2004-02-28','2005-02-28'); +select timestampdiff(month,'2004-03-29','2005-03-28'); +select timestampdiff(month,'2003-02-28','2004-02-29'); +select timestampdiff(month,'2003-02-28','2005-02-28'); + +select timestampdiff(month,'1999-09-11','2001-10-10'); +select timestampdiff(month,'1999-09-11','2001-9-11'); + +select timestampdiff(year,'1999-09-11','2001-9-11'); +select timestampdiff(year,'2004-02-28','2005-02-28'); +select timestampdiff(year,'2004-02-29','2005-02-28'); + # End of 5.0 tests |