diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_sapdb.result | 12 | ||||
-rw-r--r-- | mysql-test/t/func_sapdb.test | 17 |
2 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index 4db0416bdce..a06d7004908 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -256,3 +256,15 @@ a select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") 2003-01-02 10:11:12.001200 +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00'); +timediff('2008-09-29 20:10:10','2008-09-30 20:10:10') time('00:00:00') +-24:00:00 00:00:00 +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00'); +timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00') +0 +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00'); +timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00') +1 +SELECT CAST(time('-73:42:12') AS DECIMAL); +CAST(time('-73:42:12') AS DECIMAL) +-734212 diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 5db6db70e8f..f37ee0c39f0 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -135,3 +135,20 @@ select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f"); --enable_ps_protocol # End of 4.1 tests + + + +# +# Bug#37553: MySql Error Compare TimeDiff & Time +# + +# calculations involving negative time values ignored sign +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10'),time('00:00:00'); +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')>time('00:00:00'); +select timediff('2008-09-29 20:10:10','2008-09-30 20:10:10')<time('00:00:00'); + +# show that conversion to DECIMAL no longer drops sign +SELECT CAST(time('-73:42:12') AS DECIMAL); + + +# End of 5.0 tests |