diff options
author | unknown <kaa@kaamos.(none)> | 2008-03-19 16:31:26 +0300 |
---|---|---|
committer | unknown <kaa@kaamos.(none)> | 2008-03-19 16:31:26 +0300 |
commit | c0ba9a9eef0719167297bafc09cab7c62cc1733e (patch) | |
tree | faac6f1e1a397791874558807382471c3c5cecaf /sql/item_sum.cc | |
parent | 842fd8ba5e3e5c6f1d3f545a1e263e0582e02ddd (diff) | |
parent | e829d36367a831974d081d8fa7cb9273204b5b25 (diff) | |
download | mariadb-git-c0ba9a9eef0719167297bafc09cab7c62cc1733e.tar.gz |
Merge kaamos.(none):/data/src/opt/bug34512/my51
into kaamos.(none):/data/src/opt/mysql-5.1-opt
sql/item_sum.cc:
Auto merged
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 4a4ee5fa73c..ce9e2ad906c 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1228,7 +1228,15 @@ my_decimal *Item_sum_avg::val_decimal(my_decimal *val) null_value=1; return NULL; } - sum_dec= Item_sum_sum::val_decimal(&sum_buff); + + /* + For non-DECIMAL hybrid_type the division will be done in + Item_sum_avg::val_real(). + */ + if (hybrid_type != DECIMAL_RESULT) + return val_decimal_from_real(val); + + sum_dec= dec_buffs + curr_dec_buff; int2my_decimal(E_DEC_FATAL_ERROR, count, 0, &cnt); my_decimal_div(E_DEC_FATAL_ERROR, val, sum_dec, &cnt, prec_increment); return val; |