summaryrefslogtreecommitdiff
path: root/sql/sql_analyse.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_analyse.h')
-rw-r--r--sql/sql_analyse.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index 21a37209e89..827b6f4b217 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -127,9 +127,9 @@ public:
String *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);
else
- s->set((ulonglong2double(sum) / ulonglong2double(rows - nulls)),
+ s->set_real((ulonglong2double(sum) / ulonglong2double(rows - nulls)),
DEC_IN_AVG,my_thd_charset);
return s;
}
@@ -143,7 +143,7 @@ public:
};
-int collect_decimal(char *element, element_count count,
+int collect_decimal(uchar *element, element_count count,
TREE_INFO *info);
class field_decimal :public field_info
@@ -165,7 +165,7 @@ public:
String *get_min_arg(String *);
String *get_max_arg(String *);
String *avg(String *s, ha_rows rows);
- friend int collect_decimal(char *element, element_count count,
+ friend int collect_decimal(uchar *element, element_count count,
TREE_INFO *info);
tree_walk_action collect_enum()
{ return (tree_walk_action) collect_decimal; }
@@ -189,34 +189,34 @@ public:
void add();
void get_opt_type(String*, ha_rows);
- String *get_min_arg(String *s)
- {
- s->set(min_arg, item->decimals,my_thd_charset);
- return s;
+ String *get_min_arg(String *s)
+ {
+ s->set_real(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 *get_max_arg(String *s)
+ {
+ s->set_real(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,my_thd_charset);
+ s->set_real((double) 0.0, 1,my_thd_charset);
else
- s->set(((double)sum / (double) (rows - nulls)), item->decimals,my_thd_charset);
+ s->set_real(((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,my_thd_charset);
+ s->set_real((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,my_thd_charset);
+ s->set_real(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), item->decimals,my_thd_charset);
}
return s;
}
@@ -248,21 +248,21 @@ public:
String *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);
else
- s->set(((double) sum / (double) (rows - nulls)), DEC_IN_AVG,my_thd_charset);
+ s->set_real(((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,my_thd_charset);
+ s->set_real((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,my_thd_charset);
+ s->set_real(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), DEC_IN_AVG,my_thd_charset);
}
return s;
}
@@ -292,9 +292,9 @@ public:
String *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);
else
- s->set((ulonglong2double(sum) / ulonglong2double(rows - nulls)),
+ s->set_real((ulonglong2double(sum) / ulonglong2double(rows - nulls)),
DEC_IN_AVG,my_thd_charset);
return s;
}
@@ -302,13 +302,13 @@ public:
{
double tmp = ulonglong2double(rows);
if (!(tmp - nulls))
- s->set((double) 0.0, 1,my_thd_charset);
+ s->set_real((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,my_thd_charset);
+ s->set_real(((double) tmp2 <= 0.0 ? 0.0 : sqrt(tmp2)), DEC_IN_AVG,my_thd_charset);
}
return s;
}
@@ -348,7 +348,7 @@ public:
}
virtual void add() {}
virtual bool change_columns(List<Item> &fields);
- virtual int send_row(List<Item> &fields);
+ virtual int send_row(List<Item> &field_list);
virtual void end_group(void) {}
virtual bool end_of_records(void);
friend Procedure *proc_analyse_init(THD *thd, ORDER *param,