diff options
author | unknown <holyfoot@hf-ibm.(none)> | 2005-05-05 20:06:49 +0500 |
---|---|---|
committer | unknown <holyfoot@hf-ibm.(none)> | 2005-05-05 20:06:49 +0500 |
commit | 6de14a23f7de447e4e6c4b82e2be032b05214c9a (patch) | |
tree | 28239d480c5b5f518077513738c6718aafd3584d /sql/item_sum.h | |
parent | c0f355762547c01192478b60659038b7751a1ced (diff) | |
download | mariadb-git-6de14a23f7de447e4e6c4b82e2be032b05214c9a.tar.gz |
A lot of fixes to Precision math
Mostly about precision/decimals of the results of the operations
include/decimal.h:
decimal interface changed a little
sql/field.cc:
a lot of precision/decimals related changes to the Field_new_decimal
sql/field.h:
Field_new_decimal interface changed
sql/ha_ndbcluster.cc:
f->precision should be used here
sql/item.cc:
precision/decimals counting related changes
sql/item.h:
precision/decimals counting related changes
sql/item_cmpfunc.cc:
precision/decimals counting related changes
sql/item_cmpfunc.h:
precision/decimals counting related changes
sql/item_func.cc:
precision/decimals counting related changes
sql/item_func.h:
precision/decimals counting related changes
sql/item_sum.cc:
precision/decimals counting related changes
sql/item_sum.h:
precision/decimals counting related changes
sql/my_decimal.cc:
precision/decimals counting related changes
sql/my_decimal.h:
precision/decimals counting related changes
sql/mysqld.cc:
precision/decimals counting related changes
sql/set_var.cc:
precision/decimals counting related changes
sql/sp_head.cc:
dbug_decimal_print was replaced with dbug_decimal_as_string
sql/sql_class.h:
div_precincrement variable added
sql/sql_parse.cc:
precision/decimals counting related changes
sql/sql_select.cc:
precision/decimals counting related changes
sql/sql_show.cc:
Field::representation_length was removed
strings/decimal.c:
decimal_actual_fraction was introduced
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/item_sum.h')
-rw-r--r-- | sql/item_sum.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sql/item_sum.h b/sql/item_sum.h index 8c8360b0726..fb72fed1c5e 100644 --- a/sql/item_sum.h +++ b/sql/item_sum.h @@ -237,6 +237,7 @@ private: Item_sum_avg_distinct(THD *thd, Item_sum_avg_distinct *original) :Item_sum_distinct(thd, original) {} public: + uint prec_increment; Item_sum_avg_distinct(Item *item_arg) : Item_sum_distinct(item_arg) {} void fix_length_and_dec(); @@ -343,8 +344,8 @@ class Item_avg_field :public Item_result_field public: Field *field; Item_result hybrid_type; - uint f_precision, f_scale; - uint dec_bin_size; + uint f_precision, f_scale, dec_bin_size; + uint prec_increment; Item_avg_field(Item_result res_type, Item_sum_avg *item); enum Type type() const { return FIELD_AVG_ITEM; } double val_real(); @@ -366,12 +367,14 @@ class Item_sum_avg :public Item_sum_sum { public: ulonglong count; - uint f_precision, f_scale; - uint dec_bin_size; + uint prec_increment; + uint f_precision, f_scale, dec_bin_size; Item_sum_avg(Item *item_par) :Item_sum_sum(item_par), count(0) {} Item_sum_avg(THD *thd, Item_sum_avg *item) - :Item_sum_sum(thd, item), count(item->count) {} + :Item_sum_sum(thd, item), count(item->count), + prec_increment(item->prec_increment) {} + void fix_length_and_dec(); enum Sumfunctype sum_func () const {return AVG_FUNC;} void clear(); @@ -402,6 +405,7 @@ public: uint f_precision1, f_scale1; uint dec_bin_size0, dec_bin_size1; uint sample; + uint prec_increment; Item_variance_field(Item_sum_variance *item); enum Type type() const {return FIELD_VARIANCE_ITEM; } double val_real(); @@ -446,6 +450,7 @@ public: uint f_precision1, f_scale1; uint dec_bin_size0, dec_bin_size1; uint sample; + uint prec_increment; Item_sum_variance(Item *item_par, uint sample_arg) :Item_sum_num(item_par), hybrid_type(REAL_RESULT), cur_dec(0), count(0), sample(sample_arg) |