Commit 34c82387 authored by unknown's avatar unknown

Merge mysql.com:/home/hf/work/mysql-5.0.clean

into mysql.com:/home/hf/work/mysql-5.0.10004
parents bbe5e7b6 370e02d1
...@@ -857,3 +857,6 @@ NULL ...@@ -857,3 +857,6 @@ NULL
Warnings: Warnings:
Error 1292 Truncated incorrect DECIMAL value: '' Error 1292 Truncated incorrect DECIMAL value: ''
Error 1292 Truncated incorrect DECIMAL value: '' Error 1292 Truncated incorrect DECIMAL value: ''
select 0.190287977636363637 + 0.040372670 * 0 - 0;
0.190287977636363637 + 0.040372670 * 0 - 0
0.190287977636363637
...@@ -882,3 +882,8 @@ select 0/0; ...@@ -882,3 +882,8 @@ select 0/0;
# #
select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x; select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as x;
select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x; select 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 1 as x;
#
# Bug #10004
#
select 0.190287977636363637 + 0.040372670 * 0 - 0;
...@@ -1709,19 +1709,23 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to) ...@@ -1709,19 +1709,23 @@ static int do_sub(decimal_t *from1, decimal_t *from2, decimal_t *to)
carry=1; carry=1;
else if (intg2 == intg1) else if (intg2 == intg1)
{ {
while (unlikely(stop1[frac1-1] == 0)) dec1 *end1= stop1 + (frac1 - 1);
frac1--; dec1 *end2= stop2 + (frac2 - 1);
while (unlikely(stop2[frac2-1] == 0)) while (unlikely((buf1 <= end1) && (*end1 == 0)))
frac2--; end1--;
while (buf1 < stop1+frac1 && buf2 < stop2+frac2 && *buf1 == *buf2) while (unlikely((buf2 <= end2) && (*end2 == 0)))
end2--;
frac1= (end1 - stop1) + 1;
frac2= (end2 - stop2) + 1;
while (buf1 <=end1 && buf2 <= end2 && *buf1 == *buf2)
buf1++, buf2++; buf1++, buf2++;
if (buf1 < stop1+frac1) if (buf1 <= end1)
if (buf2 < stop2+frac2) if (buf2 <= end2)
carry= *buf2 > *buf1; carry= *buf2 > *buf1;
else else
carry= 0; carry= 0;
else else
if (buf2 < stop2+frac2) if (buf2 <= end2)
carry=1; carry=1;
else /* short-circuit everything: from1 == from2 */ else /* short-circuit everything: from1 == from2 */
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment