Loading sql/item.h +17 −17 Original line number Diff line number Diff line Loading @@ -1496,62 +1496,62 @@ class Item_copy_string :public Item }; class Item_buff :public Sql_alloc class Cached_item :public Sql_alloc { public: my_bool null_value; Item_buff() :null_value(0) {} Cached_item() :null_value(0) {} virtual bool cmp(void)=0; virtual ~Item_buff(); /*line -e1509 */ virtual ~Cached_item(); /*line -e1509 */ }; class Item_str_buff :public Item_buff class Cached_item_str :public Cached_item { Item *item; String value,tmp_value; public: Item_str_buff(THD *thd, Item *arg); Cached_item_str(THD *thd, Item *arg); bool cmp(void); ~Item_str_buff(); // Deallocate String:s ~Cached_item_str(); // Deallocate String:s }; class Item_real_buff :public Item_buff class Cached_item_real :public Cached_item { Item *item; double value; public: Item_real_buff(Item *item_par) :item(item_par),value(0.0) {} Cached_item_real(Item *item_par) :item(item_par),value(0.0) {} bool cmp(void); }; class Item_int_buff :public Item_buff class Cached_item_int :public Cached_item { Item *item; longlong value; public: Item_int_buff(Item *item_par) :item(item_par),value(0) {} Cached_item_int(Item *item_par) :item(item_par),value(0) {} bool cmp(void); }; class Item_decimal_buff :public Item_buff class Cached_item_decimal :public Cached_item { Item *item; my_decimal value; public: Item_decimal_buff(Item *item_par); Cached_item_decimal(Item *item_par); bool cmp(void); }; class Item_field_buff :public Item_buff class Cached_item_field :public Cached_item { char *buff; Field *field; uint length; public: Item_field_buff(Item_field *item) Cached_item_field(Item_field *item) { field=item->field; buff= (char*) sql_calloc(length=field->pack_length()); Loading Loading @@ -1879,7 +1879,7 @@ void mark_select_range_as_dependent(THD *thd, Field *found_field, Item *found_item, Item_ident *resolved_item); extern Item_buff *new_Item_buff(THD *thd, Item *item); extern Cached_item *new_Cached_item(THD *thd, Item *item); extern Item_result item_cmp_type(Item_result a,Item_result b); extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item); extern bool field_is_equal_to_item(Field *field,Item *item); sql/item_buff.cc +18 −18 Original line number Diff line number Diff line Loading @@ -20,23 +20,23 @@ #include "mysql_priv.h" /* ** Create right type of item_buffer for an item ** Create right type of Cached_item for an item */ Item_buff *new_Item_buff(THD *thd, Item *item) Cached_item *new_Cached_item(THD *thd, Item *item) { if (item->type() == Item::FIELD_ITEM && !(((Item_field *) item)->field->flags & BLOB_FLAG)) return new Item_field_buff((Item_field *) item); return new Cached_item_field((Item_field *) item); switch (item->result_type()) { case STRING_RESULT: return new Item_str_buff(thd, (Item_field *) item); return new Cached_item_str(thd, (Item_field *) item); case INT_RESULT: return new Item_int_buff((Item_field *) item); return new Cached_item_int((Item_field *) item); case REAL_RESULT: return new Item_real_buff(item); return new Cached_item_real(item); case DECIMAL_RESULT: return new Item_decimal_buff(item); return new Cached_item_decimal(item); case ROW_RESULT: default: DBUG_ASSERT(0); Loading @@ -44,18 +44,18 @@ Item_buff *new_Item_buff(THD *thd, Item *item) } } Item_buff::~Item_buff() {} Cached_item::~Cached_item() {} /* ** Compare with old value and replace value with new value ** Return true if values have changed */ Item_str_buff::Item_str_buff(THD *thd, Item *arg) Cached_item_str::Cached_item_str(THD *thd, Item *arg) :item(arg), value(min(arg->max_length, thd->variables.max_sort_length)) {} bool Item_str_buff::cmp(void) bool Cached_item_str::cmp(void) { String *res; bool tmp; Loading @@ -77,12 +77,12 @@ bool Item_str_buff::cmp(void) return tmp; } Item_str_buff::~Item_str_buff() Cached_item_str::~Cached_item_str() { item=0; // Safety } bool Item_real_buff::cmp(void) bool Cached_item_real::cmp(void) { double nr= item->val_real(); if (null_value != item->null_value || nr != value) Loading @@ -94,7 +94,7 @@ bool Item_real_buff::cmp(void) return FALSE; } bool Item_int_buff::cmp(void) bool Cached_item_int::cmp(void) { longlong nr=item->val_int(); if (null_value != item->null_value || nr != value) Loading @@ -107,7 +107,7 @@ bool Item_int_buff::cmp(void) } bool Item_field_buff::cmp(void) bool Cached_item_field::cmp(void) { bool tmp= field->cmp(buff) != 0; // This is not a blob! if (tmp) Loading @@ -121,14 +121,14 @@ bool Item_field_buff::cmp(void) } Item_decimal_buff::Item_decimal_buff(Item *it) Cached_item_decimal::Cached_item_decimal(Item *it) :item(it) { my_decimal_set_zero(&value); } bool Item_decimal_buff::cmp() bool Cached_item_decimal::cmp() { my_decimal tmp; my_decimal *ptmp= item->val_decimal(&tmp); Loading @@ -147,6 +147,6 @@ bool Item_decimal_buff::cmp() *****************************************************************************/ #ifdef __GNUC__ template class List<Item_buff>; template class List_iterator<Item_buff>; template class List<Cached_item>; template class List_iterator<Cached_item>; #endif sql/item_func.cc +1 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,7 @@ bool Item_func::agg_arg_charsets(DTCollation &coll, } THD *thd= current_thd; Item_arena *arena, backup; Query_arena *arena, backup; bool res= FALSE; /* In case we're in statement prepare, create conversion item Loading sql/item_subselect.cc +2 −2 Original line number Diff line number Diff line Loading @@ -340,7 +340,7 @@ Item_singlerow_subselect::select_transformer(JOIN *join) return RES_OK; SELECT_LEX *select_lex= join->select_lex; Item_arena *arena= thd->current_arena; Query_arena *arena= thd->current_arena; if (!select_lex->master_unit()->first_select()->next_select() && !select_lex->table_list.elements && Loading Loading @@ -1164,7 +1164,7 @@ Item_in_subselect::select_transformer(JOIN *join) Item_subselect::trans_res Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func) { Item_arena *arena, backup; Query_arena *arena, backup; SELECT_LEX *current= thd->lex->current_select, *up; const char *save_where= thd->where; Item_subselect::trans_res res= RES_ERROR; Loading sql/sp_head.cc +4 −4 Original line number Diff line number Diff line Loading @@ -310,7 +310,7 @@ sp_head::operator delete(void *ptr, size_t size) sp_head::sp_head() :Item_arena((bool)FALSE), m_returns_cs(NULL), m_has_return(FALSE), :Query_arena((bool)FALSE), m_returns_cs(NULL), m_has_return(FALSE), m_simple_case(FALSE), m_multi_results(FALSE), m_in_handler(FALSE) { extern byte * Loading Loading @@ -574,7 +574,7 @@ sp_head::execute(THD *thd) sp_rcontext *ctx; int ret= 0; uint ip= 0; Item_arena *old_arena; Query_arena *old_arena; query_id_t old_query_id; TABLE *old_derived_tables; LEX *old_lex; Loading Loading @@ -2312,7 +2312,7 @@ sp_head::add_used_tables_to_table_list(THD *thd, TABLE_LIST ***query_tables_last_ptr) { uint i; Item_arena *arena, backup; Query_arena *arena, backup; bool result= FALSE; DBUG_ENTER("sp_head::add_used_tables_to_table_list"); Loading Loading
sql/item.h +17 −17 Original line number Diff line number Diff line Loading @@ -1496,62 +1496,62 @@ class Item_copy_string :public Item }; class Item_buff :public Sql_alloc class Cached_item :public Sql_alloc { public: my_bool null_value; Item_buff() :null_value(0) {} Cached_item() :null_value(0) {} virtual bool cmp(void)=0; virtual ~Item_buff(); /*line -e1509 */ virtual ~Cached_item(); /*line -e1509 */ }; class Item_str_buff :public Item_buff class Cached_item_str :public Cached_item { Item *item; String value,tmp_value; public: Item_str_buff(THD *thd, Item *arg); Cached_item_str(THD *thd, Item *arg); bool cmp(void); ~Item_str_buff(); // Deallocate String:s ~Cached_item_str(); // Deallocate String:s }; class Item_real_buff :public Item_buff class Cached_item_real :public Cached_item { Item *item; double value; public: Item_real_buff(Item *item_par) :item(item_par),value(0.0) {} Cached_item_real(Item *item_par) :item(item_par),value(0.0) {} bool cmp(void); }; class Item_int_buff :public Item_buff class Cached_item_int :public Cached_item { Item *item; longlong value; public: Item_int_buff(Item *item_par) :item(item_par),value(0) {} Cached_item_int(Item *item_par) :item(item_par),value(0) {} bool cmp(void); }; class Item_decimal_buff :public Item_buff class Cached_item_decimal :public Cached_item { Item *item; my_decimal value; public: Item_decimal_buff(Item *item_par); Cached_item_decimal(Item *item_par); bool cmp(void); }; class Item_field_buff :public Item_buff class Cached_item_field :public Cached_item { char *buff; Field *field; uint length; public: Item_field_buff(Item_field *item) Cached_item_field(Item_field *item) { field=item->field; buff= (char*) sql_calloc(length=field->pack_length()); Loading Loading @@ -1879,7 +1879,7 @@ void mark_select_range_as_dependent(THD *thd, Field *found_field, Item *found_item, Item_ident *resolved_item); extern Item_buff *new_Item_buff(THD *thd, Item *item); extern Cached_item *new_Cached_item(THD *thd, Item *item); extern Item_result item_cmp_type(Item_result a,Item_result b); extern void resolve_const_item(THD *thd, Item **ref, Item *cmp_item); extern bool field_is_equal_to_item(Field *field,Item *item);
sql/item_buff.cc +18 −18 Original line number Diff line number Diff line Loading @@ -20,23 +20,23 @@ #include "mysql_priv.h" /* ** Create right type of item_buffer for an item ** Create right type of Cached_item for an item */ Item_buff *new_Item_buff(THD *thd, Item *item) Cached_item *new_Cached_item(THD *thd, Item *item) { if (item->type() == Item::FIELD_ITEM && !(((Item_field *) item)->field->flags & BLOB_FLAG)) return new Item_field_buff((Item_field *) item); return new Cached_item_field((Item_field *) item); switch (item->result_type()) { case STRING_RESULT: return new Item_str_buff(thd, (Item_field *) item); return new Cached_item_str(thd, (Item_field *) item); case INT_RESULT: return new Item_int_buff((Item_field *) item); return new Cached_item_int((Item_field *) item); case REAL_RESULT: return new Item_real_buff(item); return new Cached_item_real(item); case DECIMAL_RESULT: return new Item_decimal_buff(item); return new Cached_item_decimal(item); case ROW_RESULT: default: DBUG_ASSERT(0); Loading @@ -44,18 +44,18 @@ Item_buff *new_Item_buff(THD *thd, Item *item) } } Item_buff::~Item_buff() {} Cached_item::~Cached_item() {} /* ** Compare with old value and replace value with new value ** Return true if values have changed */ Item_str_buff::Item_str_buff(THD *thd, Item *arg) Cached_item_str::Cached_item_str(THD *thd, Item *arg) :item(arg), value(min(arg->max_length, thd->variables.max_sort_length)) {} bool Item_str_buff::cmp(void) bool Cached_item_str::cmp(void) { String *res; bool tmp; Loading @@ -77,12 +77,12 @@ bool Item_str_buff::cmp(void) return tmp; } Item_str_buff::~Item_str_buff() Cached_item_str::~Cached_item_str() { item=0; // Safety } bool Item_real_buff::cmp(void) bool Cached_item_real::cmp(void) { double nr= item->val_real(); if (null_value != item->null_value || nr != value) Loading @@ -94,7 +94,7 @@ bool Item_real_buff::cmp(void) return FALSE; } bool Item_int_buff::cmp(void) bool Cached_item_int::cmp(void) { longlong nr=item->val_int(); if (null_value != item->null_value || nr != value) Loading @@ -107,7 +107,7 @@ bool Item_int_buff::cmp(void) } bool Item_field_buff::cmp(void) bool Cached_item_field::cmp(void) { bool tmp= field->cmp(buff) != 0; // This is not a blob! if (tmp) Loading @@ -121,14 +121,14 @@ bool Item_field_buff::cmp(void) } Item_decimal_buff::Item_decimal_buff(Item *it) Cached_item_decimal::Cached_item_decimal(Item *it) :item(it) { my_decimal_set_zero(&value); } bool Item_decimal_buff::cmp() bool Cached_item_decimal::cmp() { my_decimal tmp; my_decimal *ptmp= item->val_decimal(&tmp); Loading @@ -147,6 +147,6 @@ bool Item_decimal_buff::cmp() *****************************************************************************/ #ifdef __GNUC__ template class List<Item_buff>; template class List_iterator<Item_buff>; template class List<Cached_item>; template class List_iterator<Cached_item>; #endif
sql/item_func.cc +1 −1 Original line number Diff line number Diff line Loading @@ -161,7 +161,7 @@ bool Item_func::agg_arg_charsets(DTCollation &coll, } THD *thd= current_thd; Item_arena *arena, backup; Query_arena *arena, backup; bool res= FALSE; /* In case we're in statement prepare, create conversion item Loading
sql/item_subselect.cc +2 −2 Original line number Diff line number Diff line Loading @@ -340,7 +340,7 @@ Item_singlerow_subselect::select_transformer(JOIN *join) return RES_OK; SELECT_LEX *select_lex= join->select_lex; Item_arena *arena= thd->current_arena; Query_arena *arena= thd->current_arena; if (!select_lex->master_unit()->first_select()->next_select() && !select_lex->table_list.elements && Loading Loading @@ -1164,7 +1164,7 @@ Item_in_subselect::select_transformer(JOIN *join) Item_subselect::trans_res Item_in_subselect::select_in_like_transformer(JOIN *join, Comp_creator *func) { Item_arena *arena, backup; Query_arena *arena, backup; SELECT_LEX *current= thd->lex->current_select, *up; const char *save_where= thd->where; Item_subselect::trans_res res= RES_ERROR; Loading
sql/sp_head.cc +4 −4 Original line number Diff line number Diff line Loading @@ -310,7 +310,7 @@ sp_head::operator delete(void *ptr, size_t size) sp_head::sp_head() :Item_arena((bool)FALSE), m_returns_cs(NULL), m_has_return(FALSE), :Query_arena((bool)FALSE), m_returns_cs(NULL), m_has_return(FALSE), m_simple_case(FALSE), m_multi_results(FALSE), m_in_handler(FALSE) { extern byte * Loading Loading @@ -574,7 +574,7 @@ sp_head::execute(THD *thd) sp_rcontext *ctx; int ret= 0; uint ip= 0; Item_arena *old_arena; Query_arena *old_arena; query_id_t old_query_id; TABLE *old_derived_tables; LEX *old_lex; Loading Loading @@ -2312,7 +2312,7 @@ sp_head::add_used_tables_to_table_list(THD *thd, TABLE_LIST ***query_tables_last_ptr) { uint i; Item_arena *arena, backup; Query_arena *arena, backup; bool result= FALSE; DBUG_ENTER("sp_head::add_used_tables_to_table_list"); Loading