diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-06-27 20:35:26 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-06-27 20:35:26 +0200 |
commit | 658992699b204da04382142e77af042c8a33a334 (patch) | |
tree | 464bc87eae9ffb0fd1a7ba6fa11148b50a295d6b /mysql-test/t/func_time.test | |
parent | fe7e334f3e238368e18fc2ccb98b3357ecb1e03e (diff) | |
parent | a6087e7dc1ef3561d8189c8db15e9591d0f9b520 (diff) | |
download | mariadb-git-658992699b204da04382142e77af042c8a33a334.tar.gz |
Merge tag 'mariadb-10.0.20' into 10.1
Diffstat (limited to 'mysql-test/t/func_time.test')
-rw-r--r-- | mysql-test/t/func_time.test | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 2b189765bbc..3fb87e91b17 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -1649,3 +1649,44 @@ INSERT INTO t1 VALUES (17, NULL); INSERT INTO t1 VALUES (18, '2010-10-13'); SELECT a.id,a.date1,FROM_DAYS(TO_DAYS(a.date1)-10) as date2, DATE_ADD(a.date1,INTERVAL -10 DAY),TO_DAYS(a.date1)-10 FROM t1 a ORDER BY a.id; DROP TABLE t1; + + +--echo # +--echo # Start of 10.0 tests +--echo # + +--echo # +--echo # MDEV-8205 timediff returns null when comparing decimal time to time string value +--echo # + +# 1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-01-01 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140101010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140101010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-01-01 01:00:00' ) AS dec_str; + +# 1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-01-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140102010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140102010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-01-02 01:00:00' ) AS dec_str; + +# 1M1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-02-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140202010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140202010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-02-02 01:00:00' ) AS dec_str; + +# 2M1D1h difference +SELECT + TIMEDIFF('2014-01-01 00:00:00' , '2014-03-02 01:00:00' ) AS str_str, + TIMEDIFF('2014-01-01 00:00:00' , 20140302010000.000 ) AS str_dec, + TIMEDIFF(20140101000000.000 , 20140302010000.000 ) AS dec_dec, + TIMEDIFF(20140101000000.000 , '2014-03-02 01:00:00' ) AS dec_str; + +--echo # +--echo # End of 10.0 tests +--echo # |