#include <item_strfunc.h>
Inheritance diagram for Item_func_make_set:


Public Member Functions | |
| Item_func_make_set (Item *a, List< Item > &list) | |
| String * | val_str (String *str) |
| bool | fix_fields (THD *thd, Item **ref) |
| void | split_sum_func (THD *thd, Item **ref_pointer_array, List< Item > &fields) |
| void | fix_length_and_dec () |
| void | update_used_tables () |
| const char * | func_name () const |
| bool | walk (Item_processor processor, bool walk_subquery, byte *arg) |
| Item * | transform (Item_transformer transformer, byte *arg) |
| void | print (String *str) |
Private Attributes | |
| Item * | item |
| String | tmp_str |
Definition at line 462 of file item_strfunc.h.
Reimplemented from Item_func.
Definition at line 470 of file item_strfunc.h.
References Item::check_cols(), DBUG_ASSERT, Item_func::fix_fields(), Item::fix_fields(), Item::fixed, and item.
00471 { 00472 DBUG_ASSERT(fixed == 0); 00473 return ((!item->fixed && item->fix_fields(thd, &item)) || 00474 item->check_cols(1) || 00475 Item_func::fix_fields(thd, ref)); 00476 }
Here is the call graph for this function:

| void Item_func_make_set::fix_length_and_dec | ( | ) | [virtual] |
Implements Item_result_field.
Definition at line 1975 of file item_strfunc.cc.
References Item_func::agg_arg_charsets(), Item_func::arg_count, Item_func::args, Item::collation, Item::const_item(), Item_func::const_item_cache, item, Item::max_length, MY_COLL_ALLOW_CONV, Item::not_null_tables(), Item_func::not_null_tables_cache, Item::used_tables(), Item_func::used_tables_cache, and Item::with_sum_func.
01976 { 01977 max_length=arg_count-1; 01978 01979 if (agg_arg_charsets(collation, args, arg_count, MY_COLL_ALLOW_CONV, 1)) 01980 return; 01981 01982 for (uint i=0 ; i < arg_count ; i++) 01983 max_length+=args[i]->max_length; 01984 01985 used_tables_cache|= item->used_tables(); 01986 not_null_tables_cache&= item->not_null_tables(); 01987 const_item_cache&= item->const_item(); 01988 with_sum_func= with_sum_func || item->with_sum_func; 01989 }
Here is the call graph for this function:

| const char* Item_func_make_set::func_name | ( | ) | const [inline, virtual] |
| void Item_func_make_set::print | ( | String * | str | ) | [virtual] |
Reimplemented from Item_func.
Definition at line 2054 of file item_strfunc.cc.
References String::append(), Item_func::arg_count, item, Item::print(), Item_func::print_args(), and STRING_WITH_LEN.
02055 { 02056 str->append(STRING_WITH_LEN("make_set(")); 02057 item->print(str); 02058 if (arg_count) 02059 { 02060 str->append(','); 02061 print_args(str, 0); 02062 } 02063 str->append(')'); 02064 }
Here is the call graph for this function:

| void Item_func_make_set::split_sum_func | ( | THD * | thd, | |
| Item ** | ref_pointer_array, | |||
| List< Item > & | fields | |||
| ) | [virtual] |
Reimplemented from Item_func.
Definition at line 1967 of file item_strfunc.cc.
References item, Item_func::split_sum_func(), Item::split_sum_func2(), and TRUE.
01969 { 01970 item->split_sum_func2(thd, ref_pointer_array, fields, &item, TRUE); 01971 Item_str_func::split_sum_func(thd, ref_pointer_array, fields); 01972 }
Here is the call graph for this function:

| Item* Item_func_make_set::transform | ( | Item_transformer | transformer, | |
| byte * | arg | |||
| ) | [inline, virtual] |
Reimplemented from Item_func.
Definition at line 487 of file item_strfunc.h.
References item, Item::new_item(), Item_func::transform(), and Item::transform().
00488 { 00489 Item *new_item= item->transform(transformer, arg); 00490 if (!new_item) 00491 return 0; 00492 item= new_item; 00493 return Item_str_func::transform(transformer, arg); 00494 }
Here is the call graph for this function:

| void Item_func_make_set::update_used_tables | ( | ) | [virtual] |
Reimplemented from Item_func.
Definition at line 1992 of file item_strfunc.cc.
References Item::const_item(), Item_func::const_item_cache, item, Item::update_used_tables(), Item_func::update_used_tables(), Item::used_tables(), and Item_func::used_tables_cache.
01993 { 01994 Item_func::update_used_tables(); 01995 item->update_used_tables(); 01996 used_tables_cache|=item->used_tables(); 01997 const_item_cache&=item->const_item(); 01998 }
Here is the call graph for this function:

Implements Item.
Definition at line 2001 of file item_strfunc.cc.
References String::alloc(), String::append(), Item_func::arg_count, Item_func::args, String::copy(), DBUG_ASSERT, Item::fixed, item, String::length(), my_empty_string(), NULL, Item::null_value, tmp_str, and Item::val_int().
02002 { 02003 DBUG_ASSERT(fixed == 1); 02004 ulonglong bits; 02005 bool first_found=0; 02006 Item **ptr=args; 02007 String *result=&my_empty_string; 02008 02009 bits=item->val_int(); 02010 if ((null_value=item->null_value)) 02011 return NULL; 02012 02013 if (arg_count < 64) 02014 bits &= ((ulonglong) 1 << arg_count)-1; 02015 02016 for (; bits; bits >>= 1, ptr++) 02017 { 02018 if (bits & 1) 02019 { 02020 String *res= (*ptr)->val_str(str); 02021 if (res) // Skip nulls 02022 { 02023 if (!first_found) 02024 { // First argument 02025 first_found=1; 02026 if (res != str) 02027 result=res; // Use original string 02028 else 02029 { 02030 if (tmp_str.copy(*res)) // Don't use 'str' 02031 return &my_empty_string; 02032 result= &tmp_str; 02033 } 02034 } 02035 else 02036 { 02037 if (result != &tmp_str) 02038 { // Copy data to tmp_str 02039 if (tmp_str.alloc(result->length()+res->length()+1) || 02040 tmp_str.copy(*result)) 02041 return &my_empty_string; 02042 result= &tmp_str; 02043 } 02044 if (tmp_str.append(',') || tmp_str.append(*res)) 02045 return &my_empty_string; 02046 } 02047 } 02048 } 02049 } 02050 return result; 02051 }
Here is the call graph for this function:

| bool Item_func_make_set::walk | ( | Item_processor | processor, | |
| bool | walk_subquery, | |||
| byte * | arg | |||
| ) | [inline, virtual] |
Reimplemented from Item_func.
Definition at line 482 of file item_strfunc.h.
References item, Item_func::walk(), and Item::walk().
00483 { 00484 return item->walk(processor, walk_subquery, arg) || 00485 Item_str_func::walk(processor, walk_subquery, arg); 00486 }
Here is the call graph for this function:

Item* Item_func_make_set::item [private] |
Definition at line 464 of file item_strfunc.h.
Referenced by fix_fields(), fix_length_and_dec(), print(), split_sum_func(), transform(), update_used_tables(), val_str(), and walk().
String Item_func_make_set::tmp_str [private] |
1.4.7

