diff options
author | unknown <serg@serg.mylan> | 2006-06-16 12:17:20 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2006-06-16 12:17:20 +0200 |
commit | 0237d9b0af6c9ddc182fe9389d788a094608ec43 (patch) | |
tree | 5306a4b107a18f253dc8ea414ab57aff0800f12c /sql/sql_analyse.cc | |
parent | 2996b49af72ab0ceef02c13ef5279e59ae9e4eeb (diff) | |
download | mariadb-git-0237d9b0af6c9ddc182fe9389d788a094608ec43.tar.gz |
String::set(double) and set(longlong) -> set_real() and set_int()
fix Field::store(double) being used instead of store(longlong)
NB: overloading functions is evil
Diffstat (limited to 'sql/sql_analyse.cc')
-rw-r--r-- | sql/sql_analyse.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc index f372c55c13e..9f1a0561138 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -1024,7 +1024,7 @@ String *field_decimal::avg(String *s, ha_rows rows) { if (!(rows - nulls)) { - s->set((double) 0.0, 1,my_thd_charset); + s->set_real((double) 0.0, 1,my_thd_charset); return s; } my_decimal num, avg_val, rounded_avg; @@ -1045,7 +1045,7 @@ String *field_decimal::std(String *s, ha_rows rows) { if (!(rows - nulls)) { - s->set((double) 0.0, 1,my_thd_charset); + s->set_real((double) 0.0, 1,my_thd_charset); return s; } my_decimal num, tmp, sum2, sum2d; @@ -1058,7 +1058,7 @@ String *field_decimal::std(String *s, ha_rows rows) my_decimal_sub(E_DEC_FATAL_ERROR, &sum2, sum_sqr+cur_sum, &tmp); my_decimal_div(E_DEC_FATAL_ERROR, &tmp, &sum2, &num, prec_increment); my_decimal2double(E_DEC_FATAL_ERROR, &tmp, &std_sqr); - s->set(((double) std_sqr <= 0.0 ? 0.0 : sqrt(std_sqr)), + s->set_real(((double) std_sqr <= 0.0 ? 0.0 : sqrt(std_sqr)), min(item->decimals + prec_increment, NOT_FIXED_DEC), my_thd_charset); return s; @@ -1092,7 +1092,7 @@ int collect_real(double *element, element_count count __attribute__((unused)), else info->found = 1; info->str->append('\''); - s.set(*element, info->item->decimals, current_thd->charset()); + s.set_real(*element, info->item->decimals, current_thd->charset()); info->str->append(s); info->str->append('\''); return 0; |