diff options
author | monty@mysql.com/narttu.mysql.fi <> | 2007-01-22 14:04:40 +0200 |
---|---|---|
committer | monty@mysql.com/narttu.mysql.fi <> | 2007-01-22 14:04:40 +0200 |
commit | a04157fbb3f2b2e054c02968ffc82bb0eb971d58 (patch) | |
tree | db1cb9732cc2b568c4a56c3f6d11cf8f4d5250b6 /sql/item_sum.cc | |
parent | 205f7a0583f5ba5cc0c6428fa6e44c74b534d8e8 (diff) | |
parent | 9d3fda77c8e20ff299f9750b64c42dfbb58a7806 (diff) | |
download | mariadb-git-a04157fbb3f2b2e054c02968ffc82bb0eb971d58.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
Diffstat (limited to 'sql/item_sum.cc')
-rw-r--r-- | sql/item_sum.cc | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sql/item_sum.cc b/sql/item_sum.cc index 8bfac058936..bdbbced6fe2 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -1157,7 +1157,7 @@ double Item_sum_avg::val_real() my_decimal *Item_sum_avg::val_decimal(my_decimal *val) { - my_decimal sum, cnt; + my_decimal sum_buff, cnt; const my_decimal *sum_dec; DBUG_ASSERT(fixed == 1); if (!count) @@ -1165,7 +1165,7 @@ my_decimal *Item_sum_avg::val_decimal(my_decimal *val) null_value=1; return NULL; } - sum_dec= Item_sum_sum::val_decimal(&sum); + sum_dec= Item_sum_sum::val_decimal(&sum_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; @@ -1608,7 +1608,7 @@ bool Item_sum_min::add() break; case DECIMAL_RESULT: { - my_decimal value, *val= args[0]->val_decimal(&value); + my_decimal value_buff, *val= args[0]->val_decimal(&value_buff); if (!args[0]->null_value && (null_value || (my_decimal_cmp(&sum_dec, val) > 0))) { @@ -1672,7 +1672,7 @@ bool Item_sum_max::add() break; case DECIMAL_RESULT: { - my_decimal value, *val= args[0]->val_decimal(&value); + my_decimal value_buff, *val= args[0]->val_decimal(&value_buff); if (!args[0]->null_value && (null_value || (my_decimal_cmp(val, &sum_dec) > 0))) { @@ -1837,7 +1837,7 @@ void Item_sum_hybrid::reset_field() } case DECIMAL_RESULT: { - my_decimal value, *arg_dec= args[0]->val_decimal(&value); + my_decimal value_buff, *arg_dec= args[0]->val_decimal(&value_buff); if (maybe_null) { @@ -2465,11 +2465,11 @@ bool Item_sum_count_distinct::setup(THD *thd) for (tree_key_length= 0; field < field_end; ++field) { Field *f= *field; - enum enum_field_types type= f->type(); + enum enum_field_types f_type= f->type(); tree_key_length+= f->pack_length(); - if ((type == MYSQL_TYPE_VARCHAR) || - !f->binary() && (type == MYSQL_TYPE_STRING || - type == MYSQL_TYPE_VAR_STRING)) + if ((f_type == MYSQL_TYPE_VARCHAR) || + !f->binary() && (f_type == MYSQL_TYPE_STRING || + f_type == MYSQL_TYPE_VAR_STRING)) { all_binary= FALSE; break; @@ -3052,8 +3052,6 @@ Item_func_group_concat::Item_func_group_concat(THD *thd, void Item_func_group_concat::cleanup() { - THD *thd= current_thd; - DBUG_ENTER("Item_func_group_concat::cleanup"); Item_sum::cleanup(); @@ -3062,7 +3060,7 @@ void Item_func_group_concat::cleanup() { char warn_buff[MYSQL_ERRMSG_SIZE]; sprintf(warn_buff, ER(ER_CUT_VALUE_GROUP_CONCAT), count_cut_values); - warning->set_msg(thd, warn_buff); + warning->set_msg(current_thd, warn_buff); warning= 0; } @@ -3092,8 +3090,7 @@ void Item_func_group_concat::cleanup() warning= 0; } } - DBUG_ASSERT(tree == 0); - DBUG_ASSERT(warning == 0); + DBUG_ASSERT(tree == 0 && warning == 0); } DBUG_VOID_RETURN; } |