#include <item_row.h>
Inheritance diagram for Item_row:


Public Member Functions | |
| Item_row (List< Item > &) | |
| Item_row (Item_row *item) | |
| enum Type | type () const |
| void | illegal_method_call (const char *) |
| bool | is_null () |
| void | make_field (Send_field *) |
| double | val_real () |
| longlong | val_int () |
| String * | val_str (String *) |
| my_decimal * | val_decimal (my_decimal *) |
| bool | fix_fields (THD *thd, Item **ref) |
| void | cleanup () |
| void | split_sum_func (THD *thd, Item **ref_pointer_array, List< Item > &fields) |
| table_map | used_tables () const |
| bool | const_item () const |
| enum Item_result | result_type () const |
| void | update_used_tables () |
| void | print (String *str) |
| bool | walk (Item_processor processor, bool walk_subquery, byte *arg) |
| Item * | transform (Item_transformer transformer, byte *arg) |
| uint | cols () |
| Item * | el (uint i) |
| Item ** | addr (uint i) |
| bool | check_cols (uint c) |
| bool | null_inside () |
| void | bring_value () |
Private Attributes | |
| Item ** | items |
| table_map | used_tables_cache |
| uint | arg_count |
| bool | const_item_cache |
| bool | with_null |
Definition at line 17 of file item_row.h.
Definition at line 28 of file item_row.cc.
References arg_count, base_list::elements, items, and sql_alloc().
00028 : 00029 Item(), used_tables_cache(0), const_item_cache(1), with_null(0) 00030 { 00031 00032 //TODO: think placing 2-3 component items in item (as it done for function) 00033 if ((arg_count= arg.elements)) 00034 items= (Item**) sql_alloc(sizeof(Item*)*arg_count); 00035 else 00036 items= 0; 00037 List_iterator<Item> li(arg); 00038 uint i= 0; 00039 Item *item; 00040 while ((item= li++)) 00041 { 00042 items[i]= item; 00043 i++; 00044 } 00045 }
Here is the call graph for this function:

| Item_row::Item_row | ( | Item_row * | item | ) | [inline] |
Definition at line 26 of file item_row.h.
00026 : 00027 Item(), 00028 items(item->items), 00029 used_tables_cache(item->used_tables_cache), 00030 arg_count(item->arg_count), 00031 const_item_cache(item->const_item_cache), 00032 with_null(0) 00033 {}
Reimplemented from Item.
Definition at line 76 of file item_row.h.
References items.
00076 { return items + i; }
| void Item_row::bring_value | ( | ) | [virtual] |
Reimplemented from Item.
Definition at line 169 of file item_row.cc.
References arg_count, and items.
00170 { 00171 for (uint i= 0; i < arg_count; i++) 00172 items[i]->bring_value(); 00173 }
Reimplemented from Item.
Definition at line 123 of file item_row.cc.
References arg_count, ER_OPERAND_COLUMNS, my_error(), and MYF.
00124 { 00125 if (c != arg_count) 00126 { 00127 my_error(ER_OPERAND_COLUMNS, MYF(0), c); 00128 return 1; 00129 } 00130 return 0; 00131 }
Here is the call graph for this function:

| void Item_row::cleanup | ( | ) | [virtual] |
Reimplemented from Item.
Definition at line 88 of file item_row.cc.
References Item::cleanup(), const_item_cache, DBUG_ENTER, DBUG_VOID_RETURN, used_tables_cache, and with_null.
00089 { 00090 DBUG_ENTER("Item_row::cleanup"); 00091 00092 Item::cleanup(); 00093 /* Reset to the original values */ 00094 used_tables_cache= 0; 00095 const_item_cache= 1; 00096 with_null= 0; 00097 00098 DBUG_VOID_RETURN; 00099 }
Here is the call graph for this function:

| uint Item_row::cols | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 74 of file item_row.h.
References arg_count.
Referenced by Item_func_interval::fix_length_and_dec(), resolve_const_item(), and Item_func_interval::val_int().
00074 { return arg_count; }
Here is the caller graph for this function:

| bool Item_row::const_item | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 66 of file item_row.h.
References const_item_cache.
Referenced by Item_func_interval::fix_length_and_dec().
00066 { return const_item_cache; };
Here is the caller graph for this function:

Reimplemented from Item.
Definition at line 75 of file item_row.h.
References items.
Referenced by Item_func_interval::fix_length_and_dec(), resolve_const_item(), and Item_func_interval::val_int().
00075 { return items[i]; }
Here is the caller graph for this function:

Reimplemented from Item.
Definition at line 56 of file item_row.cc.
References arg_count, Item::cols(), Item::const_item(), const_item_cache, DBUG_ASSERT, FALSE, Item::fixed, Item::is_null(), items, Item::maybe_null, Item::null_inside(), Item::null_value, TRUE, Item::used_tables(), used_tables_cache, with_null, and Item::with_sum_func.
00057 { 00058 DBUG_ASSERT(fixed == 0); 00059 null_value= 0; 00060 maybe_null= 0; 00061 Item **arg, **arg_end; 00062 for (arg= items, arg_end= items+arg_count; arg != arg_end ; arg++) 00063 { 00064 if ((*arg)->fix_fields(thd, arg)) 00065 return TRUE; 00066 // we can't assign 'item' before, because fix_fields() can change arg 00067 Item *item= *arg; 00068 used_tables_cache |= item->used_tables(); 00069 const_item_cache&= item->const_item() && !with_null; 00070 if (const_item_cache) 00071 { 00072 if (item->cols() > 1) 00073 with_null|= item->null_inside(); 00074 else 00075 { 00076 if (item->is_null()) 00077 with_null|= 1; 00078 } 00079 } 00080 maybe_null|= item->maybe_null; 00081 with_sum_func= with_sum_func || item->with_sum_func; 00082 } 00083 fixed= 1; 00084 return FALSE; 00085 }
Here is the call graph for this function:

| void Item_row::illegal_method_call | ( | const char * | ) |
Definition at line 47 of file item_row.cc.
References DBUG_ASSERT, DBUG_ENTER, DBUG_PRINT, DBUG_VOID_RETURN, ER_OPERAND_COLUMNS, my_error(), and MYF.
Referenced by make_field(), val_decimal(), val_int(), val_real(), and val_str().
00048 { 00049 DBUG_ENTER("Item_row::illegal_method_call"); 00050 DBUG_PRINT("error", ("!!! %s method was called for row item", method)); 00051 DBUG_ASSERT(0); 00052 my_error(ER_OPERAND_COLUMNS, MYF(0), 1); 00053 DBUG_VOID_RETURN; 00054 }
Here is the call graph for this function:

Here is the caller graph for this function:

| bool Item_row::is_null | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 37 of file item_row.h.
References Item::null_value.
00037 { return null_value; }
| void Item_row::make_field | ( | Send_field * | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 38 of file item_row.h.
References illegal_method_call().
00039 { 00040 illegal_method_call((const char*)"make_field"); 00041 };
Here is the call graph for this function:

| bool Item_row::null_inside | ( | ) | [inline, virtual] |
Reimplemented from Item.
Definition at line 78 of file item_row.h.
References with_null.
00078 { return with_null; };
| void Item_row::print | ( | String * | str | ) | [virtual] |
Reimplemented from Item.
Definition at line 133 of file item_row.cc.
References String::append(), arg_count, items, and Item::print().
00134 { 00135 str->append('('); 00136 for (uint i= 0; i < arg_count; i++) 00137 { 00138 if (i) 00139 str->append(','); 00140 items[i]->print(str); 00141 } 00142 str->append(')'); 00143 }
Here is the call graph for this function:

| enum Item_result Item_row::result_type | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 67 of file item_row.h.
References ROW_RESULT.
00067 { return ROW_RESULT; }
| Item * Item_row::transform | ( | Item_transformer | transformer, | |
| byte * | arg | |||
| ) | [virtual] |
Reimplemented from Item.
Definition at line 157 of file item_row.cc.
References arg_count, items, and Item::new_item().
00158 { 00159 for (uint i= 0; i < arg_count; i++) 00160 { 00161 Item *new_item= items[i]->transform(transformer, arg); 00162 if (!new_item) 00163 return 0; 00164 items[i]= new_item; 00165 } 00166 return (this->*transformer)(arg); 00167 }
Here is the call graph for this function:

| enum Type Item_row::type | ( | ) | const [inline, virtual] |
Implements Item.
Definition at line 35 of file item_row.h.
References Item::ROW_ITEM.
00035 { return ROW_ITEM; };
| void Item_row::update_used_tables | ( | ) | [virtual] |
Reimplemented from Item.
Definition at line 111 of file item_row.cc.
References arg_count, Item::const_item(), const_item_cache, items, Item::used_tables(), and used_tables_cache.
00112 { 00113 used_tables_cache= 0; 00114 const_item_cache= 1; 00115 for (uint i= 0; i < arg_count; i++) 00116 { 00117 items[i]->update_used_tables(); 00118 used_tables_cache|= items[i]->used_tables(); 00119 const_item_cache&= items[i]->const_item(); 00120 } 00121 }
Here is the call graph for this function:

| table_map Item_row::used_tables | ( | ) | const [inline, virtual] |
Reimplemented from Item.
Definition at line 65 of file item_row.h.
References used_tables_cache.
Referenced by Item_func_interval::fix_length_and_dec().
00065 { return used_tables_cache; };
Here is the caller graph for this function:

| my_decimal* Item_row::val_decimal | ( | my_decimal * | ) | [inline, virtual] |
Implements Item.
Definition at line 57 of file item_row.h.
References illegal_method_call().
00058 { 00059 illegal_method_call((const char*)"val_decimal"); 00060 return 0; 00061 };
Here is the call graph for this function:

| longlong Item_row::val_int | ( | void | ) | [inline, virtual] |
Implements Item.
Definition at line 47 of file item_row.h.
References illegal_method_call().
00048 { 00049 illegal_method_call((const char*)"val_int"); 00050 return 0; 00051 };
Here is the call graph for this function:

| double Item_row::val_real | ( | void | ) | [inline, virtual] |
Implements Item.
Definition at line 42 of file item_row.h.
References illegal_method_call().
00043 { 00044 illegal_method_call((const char*)"val"); 00045 return 0; 00046 };
Here is the call graph for this function:

Implements Item.
Definition at line 52 of file item_row.h.
References illegal_method_call().
00053 { 00054 illegal_method_call((const char*)"val_str"); 00055 return 0; 00056 };
Here is the call graph for this function:

| bool Item_row::walk | ( | Item_processor | processor, | |
| bool | walk_subquery, | |||
| byte * | arg | |||
| ) | [virtual] |
uint Item_row::arg_count [private] |
Definition at line 21 of file item_row.h.
Referenced by bring_value(), check_cols(), cols(), fix_fields(), Item_row(), print(), split_sum_func(), transform(), update_used_tables(), and walk().
bool Item_row::const_item_cache [private] |
Definition at line 22 of file item_row.h.
Referenced by cleanup(), const_item(), fix_fields(), and update_used_tables().
Item** Item_row::items [private] |
Definition at line 19 of file item_row.h.
Referenced by addr(), bring_value(), el(), fix_fields(), Item_row(), print(), split_sum_func(), transform(), update_used_tables(), and walk().
table_map Item_row::used_tables_cache [private] |
Definition at line 20 of file item_row.h.
Referenced by cleanup(), fix_fields(), update_used_tables(), and used_tables().
bool Item_row::with_null [private] |
1.4.7

