Commit c1386194 authored by unknown's avatar unknown

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


sql/item_sum.cc:
  curr_dec_buff should be set to 0 here
parent 5f3614ef
......@@ -656,7 +656,8 @@ my_decimal *Item_sum_sum_distinct::val_decimal(my_decimal *fake)
else
{
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);
}
......
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