diff options
author | unknown <bar@bar.mysql.r18.ru> | 2002-10-30 16:19:43 +0400 |
---|---|---|
committer | unknown <bar@bar.mysql.r18.ru> | 2002-10-30 16:19:43 +0400 |
commit | 85f35cbf574eac4bbc0f5dda0416da33da086cd0 (patch) | |
tree | afd6e4ea67b585a5ec68bd069142c6d208822c5a /sql/sql_analyse.h | |
parent | 2b6c55db1f57f5541a701c642986f5248150ed9d (diff) | |
download | mariadb-git-85f35cbf574eac4bbc0f5dda0416da33da086cd0.tar.gz |
All String->set() now have charset argument
Diffstat (limited to 'sql/sql_analyse.h')
-rw-r--r-- | sql/sql_analyse.h | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h index 403ddbe6fee..ada46374a15 100644 --- a/sql/sql_analyse.h +++ b/sql/sql_analyse.h @@ -128,10 +128,10 @@ public: String *avg(String *s, ha_rows rows) { if (!(rows - nulls)) - s->set((double) 0.0, 1); + s->set((double) 0.0, 1,my_thd_charset); else s->set((ulonglong2double(sum) / ulonglong2double(rows - nulls)), - DEC_IN_AVG); + DEC_IN_AVG,my_thd_charset); return s; } friend int collect_string(String *element, element_count count, @@ -160,26 +160,34 @@ public: void add(); void get_opt_type(String*, ha_rows); - String *get_min_arg(String *s) { s->set(min_arg, item->decimals); return s; } - String *get_max_arg(String *s) { s->set(max_arg, item->decimals); return s; } + String *get_min_arg(String *s) + { + s->set(min_arg, item->decimals,my_thd_charset); + return s; + } + String *get_max_arg(String *s) + { + s->set(max_arg, item->decimals,my_thd_charset); + return s; + } String *avg(String *s, ha_rows rows) { if (!(rows - nulls)) - s->set((double) 0.0, 1); + s->set((double) 0.0, 1,my_thd_charset); else - s->set(((double)sum / (double) (rows - nulls)), item->decimals); + s->set(((double)sum / (double) (rows - nulls)), item->decimals,my_thd_charset); return s; } String *std(String *s, ha_rows rows) { double tmp = ulonglong2double(rows); if (!(tmp - nulls)) - s->set((double) 0.0, 1); + s->set((double) 0.0, 1,my_thd_charset); else { double tmp2 = ((sum_sqr - sum * sum / (tmp - nulls)) / (tmp - nulls)); - s->set(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), item->decimals); + s->set(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), item->decimals,my_thd_charset); } return s; } @@ -206,26 +214,26 @@ public: void add(); void get_opt_type(String*, ha_rows); - String *get_min_arg(String *s) { s->set(min_arg); return s; } - String *get_max_arg(String *s) { s->set(max_arg); return s; } + String *get_min_arg(String *s) { s->set(min_arg,my_thd_charset); return s; } + String *get_max_arg(String *s) { s->set(max_arg,my_thd_charset); return s; } String *avg(String *s, ha_rows rows) { if (!(rows - nulls)) - s->set((double) 0.0, 1); + s->set((double) 0.0, 1,my_thd_charset); else - s->set(((double) sum / (double) (rows - nulls)), DEC_IN_AVG); + s->set(((double) sum / (double) (rows - nulls)), DEC_IN_AVG,my_thd_charset); return s; } String *std(String *s, ha_rows rows) { double tmp = ulonglong2double(rows); if (!(tmp - nulls)) - s->set((double) 0.0, 1); + s->set((double) 0.0, 1,my_thd_charset); else { double tmp2 = ((sum_sqr - sum * sum / (tmp - nulls)) / (tmp - nulls)); - s->set(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), DEC_IN_AVG); + s->set(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), DEC_IN_AVG,my_thd_charset); } return s; } @@ -250,28 +258,28 @@ public: (qsort_cmp2) compare_ulonglong2, 0, NULL, NULL); } void add(); void get_opt_type(String*, ha_rows); - String *get_min_arg(String *s) { s->set(min_arg); return s; } - String *get_max_arg(String *s) { s->set(max_arg); return s; } + String *get_min_arg(String *s) { s->set(min_arg,my_thd_charset); return s; } + String *get_max_arg(String *s) { s->set(max_arg,my_thd_charset); return s; } String *avg(String *s, ha_rows rows) { if (!(rows - nulls)) - s->set((double) 0.0, 1); + s->set((double) 0.0, 1,my_thd_charset); else s->set((ulonglong2double(sum) / ulonglong2double(rows - nulls)), - DEC_IN_AVG); + DEC_IN_AVG,my_thd_charset); return s; } String *std(String *s, ha_rows rows) { double tmp = ulonglong2double(rows); if (!(tmp - nulls)) - s->set((double) 0.0, 1); + s->set((double) 0.0, 1,my_thd_charset); else { double tmp2 = ((ulonglong2double(sum_sqr) - ulonglong2double(sum * sum) / (tmp - nulls)) / (tmp - nulls)); - s->set(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), DEC_IN_AVG); + s->set(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), DEC_IN_AVG,my_thd_charset); } return s; } |