From: Date: November 28 2005 11:52am Subject: bk commit into 5.0 tree (ramil:1.1993) BUG#12956 List-Archive: http://lists.mysql.com/internals/32752 X-Bug: 12956 Message-Id: <200511281052.jASAqi2m047423@myoffice.izhnet.ru> Below is the list of changes that have just been committed into a local 5.0 repository of ram. When ram does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.1993 05/11/28 14:52:38 ramil@stripped +3 -0 Fix for bug #12956: cast make differ rounding. sql/item_func.cc 1.270 05/11/28 14:52:31 ramil@stripped +1 -1 Fix for bug #12956: cast make differ rounding. - call rint() as we do in the Field_*int*::store(double) mysql-test/t/count_distinct3.test 1.5 05/11/28 14:52:31 ramil@stripped +1 -1 Fix for bug #12956: cast make differ rounding. mysql-test/r/ps.result 1.54 05/11/28 14:52:30 ramil@stripped +7 -7 Fix for bug #12956: cast make differ rounding. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: ramil # Host: myoffice.izhnet.ru # Root: /usr/home/ram/work/5.0.b12956 --- 1.269/sql/item_func.cc 2005-11-21 23:15:41 +04:00 +++ 1.270/sql/item_func.cc 2005-11-28 14:52:31 +04:00 @@ -735,7 +735,7 @@ longlong Item_func_numhybrid::val_int() case INT_RESULT: return int_op(); case REAL_RESULT: - return (longlong)real_op(); + return (longlong) rint(real_op()); case STRING_RESULT: { int err_not_used; --- 1.4/mysql-test/t/count_distinct3.test 2005-07-28 05:21:39 +05:00 +++ 1.5/mysql-test/t/count_distinct3.test 2005-11-28 14:52:31 +04:00 @@ -17,7 +17,7 @@ while ($1) SET @rnd= RAND(); SET @id = CAST(@rnd * @rnd_max AS UNSIGNED); SET @id_rev= @rnd_max - @id; - SET @grp= CAST(128.0 * @rnd AS UNSIGNED); + SET @grp= CAST(127.0 * @rnd AS UNSIGNED); INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev); dec $1; } --- 1.53/mysql-test/r/ps.result 2005-09-09 00:29:51 +05:00 +++ 1.54/mysql-test/r/ps.result 2005-11-28 14:52:30 +04:00 @@ -337,7 +337,7 @@ set @precision=10000000000; select rand(), cast(rand(10)*@precision as unsigned integer) from t1; rand() cast(rand(10)*@precision as unsigned integer) -- 6570515219 +- 6570515220 - 1282061302 - 6698761160 - 9647622201 @@ -348,23 +348,23 @@ prepare stmt from set @var=1; execute stmt using @var; rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer) -- 6570515219 - +- 6570515220 - - 1282061302 - - 6698761160 - - 9647622201 - set @var=2; execute stmt using @var; rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer) -- 6570515219 6555866465 -- 1282061302 1223466192 -- 6698761160 6449731873 +- 6570515220 6555866465 +- 1282061302 1223466193 +- 6698761160 6449731874 - 9647622201 8578261098 set @var=3; execute stmt using @var; rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer) -- 6570515219 9057697559 +- 6570515220 9057697560 - 1282061302 3730790581 -- 6698761160 1480860534 +- 6698761160 1480860535 - 9647622201 6211931236 drop table t1; deallocate prepare stmt;