diff options
author | unknown <dlenev@brandersnatch.localdomain> | 2005-01-12 12:18:36 +0300 |
---|---|---|
committer | unknown <dlenev@brandersnatch.localdomain> | 2005-01-12 12:18:36 +0300 |
commit | d853e732b9f598671283064fef6d11ea9db1d8ca (patch) | |
tree | 07b776f621873f4093ad754c602dd1f08262a197 /mysql-test | |
parent | 39ee25b3742188026dcc0bcee60951668a4a2275 (diff) | |
download | mariadb-git-d853e732b9f598671283064fef6d11ea9db1d8ca.tar.gz |
Fix for bug #7586 "TIMEDIFF for sec+microsec not working properly".
mysql-test/r/func_sapdb.result:
Added test for bug #7586 "TIMEDIFF for sec+microsec not working
properly". Corrected previously wrong results of couple other
statements.
mysql-test/t/func_sapdb.test:
Added test for bug #7586 "TIMEDIFF for sec+microsec not working
properly".
sql/item_timefunc.cc:
Item_func_timediff::val_str():
Use simplier and less error-prone implementation. Now we are counting
difference between time values in microseconds and convert it to time
value (instead of using seconds and taking difference in "second_part"s
into account).
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/func_sapdb.result | 7 | ||||
-rw-r--r-- | mysql-test/t/func_sapdb.test | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result index cf2bd687115..c74d6fc5a4e 100644 --- a/mysql-test/r/func_sapdb.result +++ b/mysql-test/r/func_sapdb.result @@ -97,13 +97,16 @@ timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002") 46:58:57.999999 select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002") --23:59:59.999999 +-24:00:00.000001 select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); timediff("1997-12-31 23:59:59.000001","23:59:59.000001") NULL select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001") -00:00:00.000001 +select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50"); +timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50") +-00:00:00.000001 select maketime(10,11,12); maketime(10,11,12) 10:11:12 @@ -175,7 +178,7 @@ f8 date YES NULL f9 time YES NULL select * from t1; f1 f2 f3 f4 f5 f6 f7 f8 f9 -1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -23:59:59 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59 +1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -24:00:00 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59 create table test(t1 datetime, t2 time, t3 time, t4 datetime); insert into test values ('2001-01-01 01:01:01', '01:01:01', null, '2001-02-01 01:01:01'), diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test index 2ae3c438243..de433485fca 100644 --- a/mysql-test/t/func_sapdb.test +++ b/mysql-test/t/func_sapdb.test @@ -54,6 +54,7 @@ select timediff("1997-12-31 23:59:59.000001","1997-12-30 01:01:01.000002"); select timediff("1997-12-30 23:59:59.000001","1997-12-31 23:59:59.000002"); select timediff("1997-12-31 23:59:59.000001","23:59:59.000001"); select timediff("2000:01:01 00:00:00", "2000:01:01 00:00:00.000001"); +select timediff("2005-01-11 15:48:49.999999", "2005-01-11 15:48:50"); --enable_ps_protocol select maketime(10,11,12); |