diff options
author | unknown <hf@deer.(none)> | 2005-02-21 20:50:56 +0400 |
---|---|---|
committer | unknown <hf@deer.(none)> | 2005-02-21 20:50:56 +0400 |
commit | 9c1130e27be47e6f6441136f3bf29a734f3e5b01 (patch) | |
tree | 7b76a2ef9d6f9548f08a38fc8fa1df34a0acdf2f /sql/item_sum.cc | |
parent | 9a1482739e7360aab41234f99613ce7c3fda9e97 (diff) | |
download | mariadb-git-9c1130e27be47e6f6441136f3bf29a734f3e5b01.tar.gz |
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
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 33cff192d06..9a4798b9dc9 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -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); } |