#include <item_cmpfunc.h>
Inheritance diagram for Item_in_optimizer:


Public Member Functions | |
| Item_in_optimizer (Item *a, Item_in_subselect *b) | |
| bool | fix_fields (THD *, Item **) |
| bool | fix_left (THD *thd, Item **ref) |
| bool | is_null () |
| longlong | val_int () |
| void | cleanup () |
| const char * | func_name () const |
| Item_cache ** | get_cache () |
| void | keep_top_level_cache () |
Protected Attributes | |
| Item_cache * | cache |
| bool | save_cache |
Definition at line 103 of file item_cmpfunc.h.
| Item_in_optimizer::Item_in_optimizer | ( | Item * | a, | |
| Item_in_subselect * | b | |||
| ) | [inline] |
Definition at line 109 of file item_cmpfunc.h.
00109 : 00110 Item_bool_func(a, my_reinterpret_cast(Item *)(b)), cache(0), save_cache(0) 00111 {} bool fix_fields(THD *, Item **);
| void Item_in_optimizer::cleanup | ( | ) | [virtual] |
Reimplemented from Item_result_field.
Definition at line 928 of file item_cmpfunc.cc.
References cache, Item_result_field::cleanup(), DBUG_ENTER, DBUG_VOID_RETURN, and save_cache.
00929 { 00930 DBUG_ENTER("Item_in_optimizer::cleanup"); 00931 Item_bool_func::cleanup(); 00932 if (!save_cache) 00933 cache= 0; 00934 DBUG_VOID_RETURN; 00935 }
Here is the call graph for this function:

Reimplemented from Item_func.
Definition at line 879 of file item_cmpfunc.cc.
References Item_func::args, subselect_engine::cols(), Item::cols(), Item::const_item(), Item_func::const_item_cache, DBUG_ASSERT, Item_subselect::engine, ER_OPERAND_COLUMNS, FALSE, fix_left(), Item::fixed, Item::maybe_null, my_error(), MYF, Item::not_null_tables(), Item_func::not_null_tables_cache, TRUE, Item::used_tables(), Item_func::used_tables_cache, and Item::with_sum_func.
Referenced by fix_left().
00880 { 00881 DBUG_ASSERT(fixed == 0); 00882 if (fix_left(thd, ref)) 00883 return TRUE; 00884 if (args[0]->maybe_null) 00885 maybe_null=1; 00886 00887 if (!args[1]->fixed && args[1]->fix_fields(thd, args+1)) 00888 return TRUE; 00889 Item_in_subselect * sub= (Item_in_subselect *)args[1]; 00890 if (args[0]->cols() != sub->engine->cols()) 00891 { 00892 my_error(ER_OPERAND_COLUMNS, MYF(0), args[0]->cols()); 00893 return TRUE; 00894 } 00895 if (args[1]->maybe_null) 00896 maybe_null=1; 00897 with_sum_func= with_sum_func || args[1]->with_sum_func; 00898 used_tables_cache|= args[1]->used_tables(); 00899 not_null_tables_cache|= args[1]->not_null_tables(); 00900 const_item_cache&= args[1]->const_item(); 00901 fixed= 1; 00902 return FALSE; 00903 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 846 of file item_cmpfunc.cc.
References Item_func::args, cache, Item::cols(), Item::const_item(), Item_func::const_item_cache, Item::el(), fix_fields(), Item::fixed, Item_cache::get_cache(), n, Item::not_null_tables(), Item_func::not_null_tables_cache, OUTER_REF_TABLE_BIT, Item_int_func::result_type(), Item_cache::set_used_tables(), Item_cache::setup(), Item::used_tables(), Item_func::used_tables(), Item_func::used_tables_cache, and Item::with_sum_func.
Referenced by fix_fields(), Item_in_subselect::row_value_transformer(), and Item_in_subselect::single_value_transformer().
00847 { 00848 if (!args[0]->fixed && args[0]->fix_fields(thd, args) || 00849 !cache && !(cache= Item_cache::get_cache(args[0]->result_type()))) 00850 return 1; 00851 00852 cache->setup(args[0]); 00853 if (cache->cols() == 1) 00854 { 00855 if ((used_tables_cache= args[0]->used_tables())) 00856 cache->set_used_tables(OUTER_REF_TABLE_BIT); 00857 else 00858 cache->set_used_tables(0); 00859 } 00860 else 00861 { 00862 uint n= cache->cols(); 00863 for (uint i= 0; i < n; i++) 00864 { 00865 if (args[0]->el(i)->used_tables()) 00866 ((Item_cache *)cache->el(i))->set_used_tables(OUTER_REF_TABLE_BIT); 00867 else 00868 ((Item_cache *)cache->el(i))->set_used_tables(0); 00869 } 00870 used_tables_cache= args[0]->used_tables(); 00871 } 00872 not_null_tables_cache= args[0]->not_null_tables(); 00873 with_sum_func= args[0]->with_sum_func; 00874 const_item_cache= args[0]->const_item(); 00875 return 0; 00876 }
Here is the call graph for this function:

Here is the caller graph for this function:

| const char* Item_in_optimizer::func_name | ( | ) | const [inline, virtual] |
| Item_cache** Item_in_optimizer::get_cache | ( | ) | [inline] |
Definition at line 125 of file item_cmpfunc.h.
References cache.
Referenced by Item_in_subselect::row_value_transformer(), and Item_in_subselect::single_value_transformer().
00125 { return &cache; }
Here is the caller graph for this function:

| bool Item_in_optimizer::is_null | ( | ) | [virtual] |
Reimplemented from Item_func.
Definition at line 938 of file item_cmpfunc.cc.
References Item_func::args, cache, Item::is_null(), Item::null_value, and Item_cache::store().
00939 { 00940 cache->store(args[0]); 00941 return (null_value= (cache->null_value || args[1]->is_null())); 00942 }
Here is the call graph for this function:

| void Item_in_optimizer::keep_top_level_cache | ( | ) |
Definition at line 921 of file item_cmpfunc.cc.
References cache, Item_cache::keep_array(), and save_cache.
Referenced by Item_in_subselect::row_value_transformer().
00922 { 00923 cache->keep_array(); 00924 save_cache= 1; 00925 }
Here is the call graph for this function:

Here is the caller graph for this function:

| longlong Item_in_optimizer::val_int | ( | ) | [virtual] |
Implements Item.
Definition at line 906 of file item_cmpfunc.cc.
References Item_func::args, cache, DBUG_ASSERT, Item::fixed, Item::null_value, Item_cache::store(), and Item::val_bool_result().
00907 { 00908 DBUG_ASSERT(fixed == 1); 00909 cache->store(args[0]); 00910 if (cache->null_value) 00911 { 00912 null_value= 1; 00913 return 0; 00914 } 00915 bool tmp= args[1]->val_bool_result(); 00916 null_value= args[1]->null_value; 00917 return tmp; 00918 }
Here is the call graph for this function:

Item_cache* Item_in_optimizer::cache [protected] |
Definition at line 106 of file item_cmpfunc.h.
Referenced by cleanup(), fix_left(), get_cache(), is_null(), keep_top_level_cache(), and val_int().
bool Item_in_optimizer::save_cache [protected] |
1.4.7

