diff options
author | unknown <sasha@mysql.sashanet.com> | 2001-08-16 12:01:35 -0600 |
---|---|---|
committer | unknown <sasha@mysql.sashanet.com> | 2001-08-16 12:01:35 -0600 |
commit | 6ca8d50cb14ac9171f4e3cf29483c414c93710e8 (patch) | |
tree | dcd5183294961fc8a3d569157a27e401d484b2c2 /mysql-test/r | |
parent | 2b8614210d1db003a6827f301dad0321b1a7478e (diff) | |
download | mariadb-git-6ca8d50cb14ac9171f4e3cf29483c414c93710e8.tar.gz |
fixed bug in Item_func_div::val_int() that broke all functions that
do val_int() on their arguments before starting the computation.
Similar fixes are need for +-* and probably several other but I want
to make sure Monty is fine with my fix approach before changing a lot
of code.
Amazingly,
this bug is not as critical as you would expect since very few functions do val_int()
on their arguments ( from_unixtime(), sec_to_time()), and those not
very frequently perform a computation on their floating point arguments.
which is probably why no one has yet reported this bug. Another
possibility is that the result is usually wrong by no more than 5%,
which makes it hard to catch it. I found it when trying to compute mile
splits for 30:47 10K - it told me 5:07, and I knew it was wrong because
5:00 mile gives you 31:08. However, if I had not run as many 10K races,
I would have easily believed that 30:47 10K is a 5:07 mile pace and
would not have noticed the bug.
mysql-test/r/func_time.result:
another test for sec_to_time that exposes a long outstanding bug
mysql-test/t/func_time.test:
another test for sec_to_time that exposes a long outstanding bug
sql/item_func.cc:
fixed bug in Item_func_div::val_int()
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/func_time.result | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index fd7c6897574..790cce9f1c1 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -6,8 +6,8 @@ now()-now() weekday(curdate())-weekday(now()) unix_timestamp()-unix_timestamp(no 0 0 0 from_unixtime(unix_timestamp("1994-03-02 10:11:12")) from_unixtime(unix_timestamp("1994-03-02 10:11:12"),"%Y-%m-%d %h:%i:%s") from_unixtime(unix_timestamp("1994-03-02 10:11:12"))+0 1994-03-02 10:11:12 1994-03-02 10:11:12 19940302101112 -sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22") -02:30:01 23001 54742 +sec_to_time(9001) sec_to_time(9001)+0 time_to_sec("15:12:22") sec_to_time(time_to_sec("0:30:47")/6.21) +02:30:01 23001 54742 00:04:57 now()-curdate()*1000000-curtime() 0 strcmp(current_timestamp(),concat(current_date()," ",current_time())) |