Commit 2b8bad59 authored by kaa@polly.local's avatar kaa@polly.local

Merge polly.local:/home/kaa/src/maint/mysql-5.0-maint

into  polly.local:/home/kaa/src/maint/mysql-5.1-maint
parents 95a0c5e7 edf6b733
...@@ -2066,7 +2066,7 @@ longlong Item_func_round::int_op() ...@@ -2066,7 +2066,7 @@ longlong Item_func_round::int_op()
else else
value= (unsigned_flag || value >= 0) ? value= (unsigned_flag || value >= 0) ?
my_unsigned_round((ulonglong) value, tmp) : my_unsigned_round((ulonglong) value, tmp) :
-my_unsigned_round((ulonglong) -value, tmp); -(longlong) my_unsigned_round((ulonglong) -value, tmp);
return value; return value;
} }
...@@ -2078,13 +2078,13 @@ my_decimal *Item_func_round::decimal_op(my_decimal *decimal_value) ...@@ -2078,13 +2078,13 @@ my_decimal *Item_func_round::decimal_op(my_decimal *decimal_value)
if (dec > 0 || (dec < 0 && args[1]->unsigned_flag)) if (dec > 0 || (dec < 0 && args[1]->unsigned_flag))
{ {
dec= min((ulonglong) dec, DECIMAL_MAX_SCALE); dec= min((ulonglong) dec, DECIMAL_MAX_SCALE);
decimals= dec; // to get correct output decimals= (uint8) dec; // to get correct output
} }
else if (dec < INT_MIN) else if (dec < INT_MIN)
dec= INT_MIN; dec= INT_MIN;
if (!(null_value= (args[0]->null_value || args[1]->null_value || if (!(null_value= (args[0]->null_value || args[1]->null_value ||
my_decimal_round(E_DEC_FATAL_ERROR, value, dec, my_decimal_round(E_DEC_FATAL_ERROR, value, (int) dec,
truncate, decimal_value) > 1))) truncate, decimal_value) > 1)))
return decimal_value; return decimal_value;
return 0; return 0;
......
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