diff options
author | serg@serg.mylan <> | 2004-08-18 19:57:55 +0200 |
---|---|---|
committer | serg@serg.mylan <> | 2004-08-18 19:57:55 +0200 |
commit | e1237cbc53355382e032f0e88f906d67edd1f597 (patch) | |
tree | 8ac7985dc9b6caddd1c2402ef8606e4a4cd85ada /sql/item_sum.h | |
parent | 7c69afaf15eda7d51b2254e71c7078aaab3aa0f3 (diff) | |
parent | 8ce92878a2c32785a5af86e9ffa27b4904d01694 (diff) | |
download | mariadb-git-e1237cbc53355382e032f0e88f906d67edd1f597.tar.gz |
manually merged
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index 507a36194de..fcace9e322a 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -282,7 +282,11 @@ public: class Item_sum_avg :public Item_sum_num { - void fix_length_and_dec() { decimals+=4; maybe_null=1; } + void fix_length_and_dec() + { + decimals=min(decimals+4, NOT_FIXED_DEC); + maybe_null=1; + } double sum; ulonglong count; @@ -337,7 +341,11 @@ class Item_sum_variance : public Item_sum_num { double sum, sum_sqr; ulonglong count; - void fix_length_and_dec() { decimals+=4; maybe_null=1; } + void fix_length_and_dec() + { + decimals=min(decimals+4, NOT_FIXED_DEC); + maybe_null=1; + } public: Item_sum_variance(Item *item_par) :Item_sum_num(item_par),count(0) {} |