Commit b5926f1d authored by hf@deer.(none)'s avatar hf@deer.(none)

Fix for bug #8651 (cast(sum(distinct) as decimal) crashes the server)

parent f7b5ef47
...@@ -656,7 +656,8 @@ my_decimal *Item_sum_sum_distinct::val_decimal(my_decimal *fake) ...@@ -656,7 +656,8 @@ my_decimal *Item_sum_sum_distinct::val_decimal(my_decimal *fake)
else else
{ {
double real= val_real(); double real= val_real();
double2my_decimal(E_DEC_FATAL_ERROR, real, dec_buffs + curr_dec_buff); curr_dec_buff= 0;
double2my_decimal(E_DEC_FATAL_ERROR, real, dec_buffs);
} }
return(dec_buffs + curr_dec_buff); return(dec_buffs + curr_dec_buff);
} }
......
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