Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg 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/in...urce-tree.html
ChangeSet
1.1843 05/03/31 13:46:46 serg (AT) serg (DOT) mylan +1 -0
correct short-circuting heuristics
strings/decimal.c
1.43 05/03/31 13:46:37 serg (AT) serg (DOT) mylan +3 -2
correct short-circuting heuristics
# 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: serg
# Host: serg.mylan
# Root: /usr/home/serg/Abk/mysql-5.0
--- 1.42/strings/decimal.c Mon Mar 21 13:58:29 2005
+++ 1.43/strings/decimal.c Thu Mar 31 13:46:37 2005
@@ -1933,7 +1933,7 @@
XXX if this library is to be used with huge numbers of thousands of
digits, fast division must be implemented and alloca should be
changed to malloc (or at least fallback to malloc if alloca() fails)
- but then, decimal_mod() should be rewritten too

+ but then, decimal_mul() should be rewritten too

*/
static int do_div_mod(decimal_t *from1, decimal_t *from2,
decimal_t *to, decimal_t *mod, int scale_incr)
@@ -2062,7 +2062,7 @@
for ( ; buf0 < stop0; buf0++)
{
/* short-circuit, if possible */
- if (unlikely(*start1 == 0))
+ if (unlikely(start1[0] == 0 && start1[1] < start2[0]))
{
start1++;
if (likely(div))
@@ -2753,6 +2753,7 @@
test_dv("1.000000000000", "3","0.333333333333333333", 0);
test_dv("1", "1","1.000000000", 0);
test_dv("0.0123456789012345678912345", "9999999999","0.0000000000012345678902469135781481 41", 0);
+ test_dv("10.333000000", "12.34500","0.837019036046982584042122316", 0);
printf("==== decimal_mod ====\n");
test_md("234","10","4", 0);
--
MySQL Internals Mailing List
For list archives: http://lists.mysql.com/internals
To unsubscribe: http://lists.mysql.com/internals?uns...ie.nctu.edu.tw