mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Code cleanup (working on PS & cleanup() code)
Item & changed with Item* in Item_xxx constructors tables_list.first -> get_table_list() sql/item.cc: Item& -> Item* sql/item.h: Item& -> Item* sql/item_cmpfunc.cc: Item& -> Item* sql/item_cmpfunc.h: Item& -> Item* sql/item_func.cc: Item& -> Item* sql/item_func.h: Item& -> Item* sql/item_sum.cc: Item& -> Item* sql/item_sum.h: Item& -> Item* sql/item_uniq.h: Item& -> Item* sql/sql_prepare.cc: Code cleanup sql/sql_select.cc: Item& -> Item*
This commit is contained in:
124
sql/item_sum.h
124
sql/item_sum.h
@ -57,7 +57,7 @@ public:
|
||||
}
|
||||
Item_sum(List<Item> &list);
|
||||
//Copy constructor, need to perform subselects with temporary tables
|
||||
Item_sum(THD *thd, Item_sum &item);
|
||||
Item_sum(THD *thd, Item_sum *item);
|
||||
void cleanup()
|
||||
{
|
||||
Item_result_field::cleanup();
|
||||
@ -110,7 +110,7 @@ public:
|
||||
Item_sum_num(Item *item_par) :Item_sum(item_par) {}
|
||||
Item_sum_num(Item *a, Item* b) :Item_sum(a,b) {}
|
||||
Item_sum_num(List<Item> &list) :Item_sum(list) {}
|
||||
Item_sum_num(THD *thd, Item_sum_num &item) :Item_sum(thd, item) {}
|
||||
Item_sum_num(THD *thd, Item_sum_num *item) :Item_sum(thd, item) {}
|
||||
bool fix_fields(THD *, TABLE_LIST *, Item **);
|
||||
longlong val_int() { return (longlong) val(); } /* Real as default */
|
||||
String *val_str(String*str);
|
||||
@ -123,7 +123,7 @@ class Item_sum_int :public Item_sum_num
|
||||
public:
|
||||
Item_sum_int(Item *item_par) :Item_sum_num(item_par) {}
|
||||
Item_sum_int(List<Item> &list) :Item_sum_num(list) {}
|
||||
Item_sum_int(THD *thd, Item_sum_int &item) :Item_sum_num(thd, item) {}
|
||||
Item_sum_int(THD *thd, Item_sum_int *item) :Item_sum_num(thd, item) {}
|
||||
double val() { return (double) val_int(); }
|
||||
String *val_str(String*str);
|
||||
enum Item_result result_type () const { return INT_RESULT; }
|
||||
@ -139,8 +139,8 @@ class Item_sum_sum :public Item_sum_num
|
||||
|
||||
public:
|
||||
Item_sum_sum(Item *item_par) :Item_sum_num(item_par),sum(0.0) {}
|
||||
Item_sum_sum(THD *thd, Item_sum_sum &item)
|
||||
:Item_sum_num(thd, item), sum(item.sum) {}
|
||||
Item_sum_sum(THD *thd, Item_sum_sum *item)
|
||||
:Item_sum_num(thd, item), sum(item->sum) {}
|
||||
enum Sumfunctype sum_func () const {return SUM_FUNC;}
|
||||
void clear();
|
||||
bool add();
|
||||
@ -162,9 +162,9 @@ class Item_sum_count :public Item_sum_int
|
||||
Item_sum_count(Item *item_par)
|
||||
:Item_sum_int(item_par),count(0),used_table_cache(~(table_map) 0)
|
||||
{}
|
||||
Item_sum_count(THD *thd, Item_sum_count &item)
|
||||
:Item_sum_int(thd, item), count(item.count),
|
||||
used_table_cache(item.used_table_cache)
|
||||
Item_sum_count(THD *thd, Item_sum_count *item)
|
||||
:Item_sum_int(thd, item), count(item->count),
|
||||
used_table_cache(item->used_table_cache)
|
||||
{}
|
||||
table_map used_tables() const { return used_table_cache; }
|
||||
bool const_item() const { return !used_table_cache; }
|
||||
@ -230,14 +230,14 @@ class Item_sum_count_distinct :public Item_sum_int
|
||||
tmp_table_param(0), tree(&tree_base), original(0), use_tree(0),
|
||||
always_null(0)
|
||||
{ quick_group= 0; }
|
||||
Item_sum_count_distinct(THD *thd, Item_sum_count_distinct &item)
|
||||
:Item_sum_int(thd, item), table(item.table),
|
||||
used_table_cache(item.used_table_cache),
|
||||
field_lengths(item.field_lengths), tmp_table_param(item.tmp_table_param),
|
||||
tree(item.tree), original(&item), key_length(item.key_length),
|
||||
max_elements_in_tree(item.max_elements_in_tree),
|
||||
rec_offset(item.rec_offset), use_tree(item.use_tree),
|
||||
always_null(item.always_null)
|
||||
Item_sum_count_distinct(THD *thd, Item_sum_count_distinct *item)
|
||||
:Item_sum_int(thd, item), table(item->table),
|
||||
used_table_cache(item->used_table_cache),
|
||||
field_lengths(item->field_lengths), tmp_table_param(item->tmp_table_param),
|
||||
tree(item->tree), original(item), key_length(item->key_length),
|
||||
max_elements_in_tree(item->max_elements_in_tree),
|
||||
rec_offset(item->rec_offset), use_tree(item->use_tree),
|
||||
always_null(item->always_null)
|
||||
{}
|
||||
void cleanup();
|
||||
|
||||
@ -285,8 +285,8 @@ class Item_sum_avg :public Item_sum_num
|
||||
|
||||
public:
|
||||
Item_sum_avg(Item *item_par) :Item_sum_num(item_par),count(0) {}
|
||||
Item_sum_avg(THD *thd, Item_sum_avg &item)
|
||||
:Item_sum_num(thd, item), sum(item.sum), count(item.count) {}
|
||||
Item_sum_avg(THD *thd, Item_sum_avg *item)
|
||||
:Item_sum_num(thd, item), sum(item->sum), count(item->count) {}
|
||||
enum Sumfunctype sum_func () const {return AVG_FUNC;}
|
||||
void clear();
|
||||
bool add();
|
||||
@ -337,9 +337,9 @@ class Item_sum_variance : public Item_sum_num
|
||||
|
||||
public:
|
||||
Item_sum_variance(Item *item_par) :Item_sum_num(item_par),count(0) {}
|
||||
Item_sum_variance(THD *thd, Item_sum_variance &item):
|
||||
Item_sum_num(thd, item), sum(item.sum), sum_sqr(item.sum_sqr),
|
||||
count(item.count) {}
|
||||
Item_sum_variance(THD *thd, Item_sum_variance *item):
|
||||
Item_sum_num(thd, item), sum(item->sum), sum_sqr(item->sum_sqr),
|
||||
count(item->count) {}
|
||||
enum Sumfunctype sum_func () const { return VARIANCE_FUNC; }
|
||||
void clear();
|
||||
bool add();
|
||||
@ -370,7 +370,7 @@ class Item_sum_std :public Item_sum_variance
|
||||
{
|
||||
public:
|
||||
Item_sum_std(Item *item_par) :Item_sum_variance(item_par) {}
|
||||
Item_sum_std(THD *thd, Item_sum_std &item)
|
||||
Item_sum_std(THD *thd, Item_sum_std *item)
|
||||
:Item_sum_variance(thd, item)
|
||||
{}
|
||||
enum Sumfunctype sum_func () const { return STD_FUNC; }
|
||||
@ -401,11 +401,11 @@ class Item_sum_hybrid :public Item_sum
|
||||
used_table_cache(~(table_map) 0),
|
||||
cmp_charset(&my_charset_bin)
|
||||
{}
|
||||
Item_sum_hybrid(THD *thd, Item_sum_hybrid &item):
|
||||
Item_sum(thd, item), value(item.value), tmp_value(item.tmp_value),
|
||||
sum(item.sum), sum_int(item.sum_int), hybrid_type(item.hybrid_type),
|
||||
hybrid_field_type(item.hybrid_field_type),cmp_sign(item.cmp_sign),
|
||||
used_table_cache(item.used_table_cache), cmp_charset(item.cmp_charset) {}
|
||||
Item_sum_hybrid(THD *thd, Item_sum_hybrid *item):
|
||||
Item_sum(thd, item), value(item->value), tmp_value(item->tmp_value),
|
||||
sum(item->sum), sum_int(item->sum_int), hybrid_type(item->hybrid_type),
|
||||
hybrid_field_type(item->hybrid_field_type),cmp_sign(item->cmp_sign),
|
||||
used_table_cache(item->used_table_cache), cmp_charset(item->cmp_charset) {}
|
||||
bool fix_fields(THD *, TABLE_LIST *, Item **);
|
||||
table_map used_tables() const { return used_table_cache; }
|
||||
bool const_item() const { return !used_table_cache; }
|
||||
@ -436,7 +436,7 @@ class Item_sum_min :public Item_sum_hybrid
|
||||
{
|
||||
public:
|
||||
Item_sum_min(Item *item_par) :Item_sum_hybrid(item_par,1) {}
|
||||
Item_sum_min(THD *thd, Item_sum_min &item) :Item_sum_hybrid(thd, item) {}
|
||||
Item_sum_min(THD *thd, Item_sum_min *item) :Item_sum_hybrid(thd, item) {}
|
||||
enum Sumfunctype sum_func () const {return MIN_FUNC;}
|
||||
|
||||
bool add();
|
||||
@ -449,7 +449,7 @@ class Item_sum_max :public Item_sum_hybrid
|
||||
{
|
||||
public:
|
||||
Item_sum_max(Item *item_par) :Item_sum_hybrid(item_par,-1) {}
|
||||
Item_sum_max(THD *thd, Item_sum_max &item) :Item_sum_hybrid(thd, item) {}
|
||||
Item_sum_max(THD *thd, Item_sum_max *item) :Item_sum_hybrid(thd, item) {}
|
||||
enum Sumfunctype sum_func () const {return MAX_FUNC;}
|
||||
|
||||
bool add();
|
||||
@ -466,8 +466,8 @@ protected:
|
||||
public:
|
||||
Item_sum_bit(Item *item_par,ulonglong reset_arg)
|
||||
:Item_sum_int(item_par),reset_bits(reset_arg),bits(reset_arg) {}
|
||||
Item_sum_bit(THD *thd, Item_sum_bit &item):
|
||||
Item_sum_int(thd, item), reset_bits(item.reset_bits), bits(item.bits) {}
|
||||
Item_sum_bit(THD *thd, Item_sum_bit *item):
|
||||
Item_sum_int(thd, item), reset_bits(item->reset_bits), bits(item->bits) {}
|
||||
enum Sumfunctype sum_func () const {return SUM_BIT_FUNC;}
|
||||
void clear();
|
||||
longlong val_int();
|
||||
@ -482,7 +482,7 @@ class Item_sum_or :public Item_sum_bit
|
||||
{
|
||||
public:
|
||||
Item_sum_or(Item *item_par) :Item_sum_bit(item_par,LL(0)) {}
|
||||
Item_sum_or(THD *thd, Item_sum_or &item) :Item_sum_bit(thd, item) {}
|
||||
Item_sum_or(THD *thd, Item_sum_or *item) :Item_sum_bit(thd, item) {}
|
||||
bool add();
|
||||
const char *func_name() const { return "bit_or"; }
|
||||
Item *copy_or_same(THD* thd);
|
||||
@ -493,7 +493,7 @@ class Item_sum_and :public Item_sum_bit
|
||||
{
|
||||
public:
|
||||
Item_sum_and(Item *item_par) :Item_sum_bit(item_par, ULONGLONG_MAX) {}
|
||||
Item_sum_and(THD *thd, Item_sum_and &item) :Item_sum_bit(thd, item) {}
|
||||
Item_sum_and(THD *thd, Item_sum_and *item) :Item_sum_bit(thd, item) {}
|
||||
bool add();
|
||||
const char *func_name() const { return "bit_and"; }
|
||||
Item *copy_or_same(THD* thd);
|
||||
@ -503,7 +503,7 @@ class Item_sum_xor :public Item_sum_bit
|
||||
{
|
||||
public:
|
||||
Item_sum_xor(Item *item_par) :Item_sum_bit(item_par,LL(0)) {}
|
||||
Item_sum_xor(THD *thd, Item_sum_xor &item) :Item_sum_bit(thd, item) {}
|
||||
Item_sum_xor(THD *thd, Item_sum_xor *item) :Item_sum_bit(thd, item) {}
|
||||
bool add();
|
||||
const char *func_name() const { return "bit_xor"; }
|
||||
Item *copy_or_same(THD* thd);
|
||||
@ -525,8 +525,8 @@ public:
|
||||
Item_udf_sum( udf_func *udf_arg, List<Item> &list )
|
||||
:Item_sum( list ), udf(udf_arg)
|
||||
{ quick_group=0;}
|
||||
Item_udf_sum(THD *thd, Item_udf_sum &item)
|
||||
:Item_sum(thd, item), udf(item.udf) {}
|
||||
Item_udf_sum(THD *thd, Item_udf_sum *item)
|
||||
:Item_sum(thd, item), udf(item->udf) {}
|
||||
const char *func_name() const { return udf.name(); }
|
||||
bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
|
||||
{
|
||||
@ -549,7 +549,7 @@ class Item_sum_udf_float :public Item_udf_sum
|
||||
Item_sum_udf_float(udf_func *udf_arg) :Item_udf_sum(udf_arg) {}
|
||||
Item_sum_udf_float(udf_func *udf_arg, List<Item> &list)
|
||||
:Item_udf_sum(udf_arg,list) {}
|
||||
Item_sum_udf_float(THD *thd, Item_sum_udf_float &item)
|
||||
Item_sum_udf_float(THD *thd, Item_sum_udf_float *item)
|
||||
:Item_udf_sum(thd, item) {}
|
||||
longlong val_int() { return (longlong) Item_sum_udf_float::val(); }
|
||||
double val();
|
||||
@ -565,7 +565,7 @@ public:
|
||||
Item_sum_udf_int(udf_func *udf_arg) :Item_udf_sum(udf_arg) {}
|
||||
Item_sum_udf_int(udf_func *udf_arg, List<Item> &list)
|
||||
:Item_udf_sum(udf_arg,list) {}
|
||||
Item_sum_udf_int(THD *thd, Item_sum_udf_int &item)
|
||||
Item_sum_udf_int(THD *thd, Item_sum_udf_int *item)
|
||||
:Item_udf_sum(thd, item) {}
|
||||
longlong val_int();
|
||||
double val() { return (double) Item_sum_udf_int::val_int(); }
|
||||
@ -582,7 +582,7 @@ public:
|
||||
Item_sum_udf_str(udf_func *udf_arg) :Item_udf_sum(udf_arg) {}
|
||||
Item_sum_udf_str(udf_func *udf_arg, List<Item> &list)
|
||||
:Item_udf_sum(udf_arg,list) {}
|
||||
Item_sum_udf_str(THD *thd, Item_sum_udf_str &item)
|
||||
Item_sum_udf_str(THD *thd, Item_sum_udf_str *item)
|
||||
:Item_udf_sum(thd, item) {}
|
||||
String *val_str(String *);
|
||||
double val()
|
||||
@ -704,31 +704,31 @@ class Item_func_group_concat : public Item_sum
|
||||
Item_func_group_concat(bool is_distinct,List<Item> *is_select,
|
||||
SQL_LIST *is_order,String *is_separator);
|
||||
|
||||
Item_func_group_concat(THD *thd, Item_func_group_concat &item)
|
||||
Item_func_group_concat(THD *thd, Item_func_group_concat *item)
|
||||
:Item_sum(thd, item),item_thd(thd),
|
||||
tmp_table_param(item.tmp_table_param),
|
||||
max_elements_in_tree(item.max_elements_in_tree),
|
||||
warning(item.warning),
|
||||
warning_available(item.warning_available),
|
||||
key_length(item.key_length),
|
||||
rec_offset(item.rec_offset),
|
||||
tree_mode(item.tree_mode),
|
||||
distinct(item.distinct),
|
||||
warning_for_row(item.warning_for_row),
|
||||
separator(item.separator),
|
||||
tree(item.tree),
|
||||
table(item.table),
|
||||
order(item.order),
|
||||
tables_list(item.tables_list),
|
||||
group_concat_max_len(item.group_concat_max_len),
|
||||
show_elements(item.show_elements),
|
||||
arg_count_order(item.arg_count_order),
|
||||
arg_count_field(item.arg_count_field),
|
||||
arg_show_fields(item.arg_show_fields),
|
||||
count_cut_values(item.count_cut_values),
|
||||
original(&item)
|
||||
tmp_table_param(item->tmp_table_param),
|
||||
max_elements_in_tree(item->max_elements_in_tree),
|
||||
warning(item->warning),
|
||||
warning_available(item->warning_available),
|
||||
key_length(item->key_length),
|
||||
rec_offset(item->rec_offset),
|
||||
tree_mode(item->tree_mode),
|
||||
distinct(item->distinct),
|
||||
warning_for_row(item->warning_for_row),
|
||||
separator(item->separator),
|
||||
tree(item->tree),
|
||||
table(item->table),
|
||||
order(item->order),
|
||||
tables_list(item->tables_list),
|
||||
group_concat_max_len(item->group_concat_max_len),
|
||||
show_elements(item->show_elements),
|
||||
arg_count_order(item->arg_count_order),
|
||||
arg_count_field(item->arg_count_field),
|
||||
arg_show_fields(item->arg_show_fields),
|
||||
count_cut_values(item->count_cut_values),
|
||||
original(item)
|
||||
{
|
||||
quick_group= item.quick_group;
|
||||
quick_group= item->quick_group;
|
||||
};
|
||||
~Item_func_group_concat();
|
||||
void cleanup();
|
||||
|
Reference in New Issue
Block a user