summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <dlenev@brandersnatch.localdomain>2005-03-28 16:20:55 +0400
committerunknown <dlenev@brandersnatch.localdomain>2005-03-28 16:20:55 +0400
commitfee4b2c2710e49fb7db286439063ca7d4265b32f (patch)
tree30e066b880d981698995d8ed3f176241106f0e74 /mysql-test/t
parent3fd639493aea5c340acc2e28617e8d917d54ff7d (diff)
downloadmariadb-git-fee4b2c2710e49fb7db286439063ca7d4265b32f.tar.gz
Fix for bug #8068 "TIMEDIFF with first negative argument gives wrong
result" (and similar bug in ADDTIME/SUBTIME). Both Item_func_add_time/Item_func_timediff::val_str() now use calc_time_diff() function which was backported from 5.0 (and which was was fixed to properly handle microseconds part of its second argument). Also now we correctly set sign of result in case when first argument is negative and second is positive. mysql-test/r/func_sapdb.result: Added test for bug #8068 "TIMEDIFF with first negative argument gives wrong result". mysql-test/t/func_sapdb.test: Added test for bug #8068 "TIMEDIFF with first negative argument gives wrong result". sql/item_timefunc.cc: - Backported calc_time_diff() function from 5.0 tree. Changed it to accept time value as its second argument when its first argument is datetime value. Fixed wrong handling of microsecond part of second argument. - Item_func_add_time::val_str()/Item_func_timediff::val_str() Removed similar pieces of code calculating difference between two datetime values (or their sum) in microseconds. Now we use calc_time_diff() function instead. Also now we correctly set sign of result in case when first argument is negative and second is positive.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/func_sapdb.test1
1 files changed, 1 insertions, 0 deletions
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index de433485fca..da3affaa36d 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -100,6 +100,7 @@ insert into test values
('2001-01-01 01:01:01', '-01:01:01', '-23:59:59', "1997-12-31 23:59:59.000001"),
('1997-12-31 23:59:59.000001', '-23:59:59', '-01:01:01', '2001-01-01 01:01:01'),
('2001-01-01 01:01:01', '01:01:01', '-1 01:01:01', null),
+('2001-01-01 01:01:01', '-01:01:01', '1 01:01:01', '2001-01-01 01:01:01'),
('2001-01-01 01:01:01', null, '-1 01:01:01', null),
(null, null, null, null),
('2001-01-01 01:01:01', '01:01:01', '1 01:01:01', '2001-01-01 01:01:01');