diff options
author | unknown <dlenev@brandersnatch.localdomain> | 2005-03-28 16:20:55 +0400 |
---|---|---|
committer | unknown <dlenev@brandersnatch.localdomain> | 2005-03-28 16:20:55 +0400 |
commit | fee4b2c2710e49fb7db286439063ca7d4265b32f (patch) | |
tree | 30e066b880d981698995d8ed3f176241106f0e74 /mysql-test/r/func_sapdb.result | |
parent | 3fd639493aea5c340acc2e28617e8d917d54ff7d (diff) | |
download | mariadb-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/r/func_sapdb.result')
-rw-r--r-- | mysql-test/r/func_sapdb.result | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index c74d6fc5a4e..68c3baa7bde 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -185,6 +185,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'); @@ -194,6 +195,7 @@ ttt qqq 2001-01-01 00:00:00 -25:01:00 1997-12-31 00:00:00 -25:01:00 2001-01-01 02:02:02 -24:00:00 +2001-01-01 00:00:00 24:00:00 NULL NULL NULL NULL 2001-01-01 02:02:02 26:02:02 @@ -203,6 +205,7 @@ ttt qqq 26305:01:02 22:58:58 -26305:01:02 -22:58:58 NULL 26:02:02 +00:00:00 -26:02:02 NULL NULL NULL NULL 00:00:00 -24:00:00 |