My Project
Public Member Functions | Static Public Member Functions | Protected Attributes
Item_cache Class Reference
Inheritance diagram for Item_cache:
Item_basic_constant Item Item_cache_datetime Item_cache_decimal Item_cache_int Item_cache_real Item_cache_row Item_cache_str

List of all members.

Public Member Functions

 Item_cache (enum_field_types field_type_arg)
void set_used_tables (table_map map)
virtual table_map resolved_used_tables () const
virtual bool allocate (uint i)
virtual bool setup (Item *item)
enum Type type () const
enum_field_types field_type () const
table_map used_tables () const
virtual void keep_array ()
virtual void print (String *str, enum_query_type query_type)
bool eq_def (Field *field)
bool eq (const Item *item, bool binary_cmp) const
bool has_value ()
Fieldfield ()
virtual void store (Item *item)
virtual bool cache_value ()=0
bool basic_const_item () const
bool walk (Item_processor processor, bool walk_subquery, uchar *argument)
virtual void clear ()
bool is_null ()
Item_result result_type () const

Static Public Member Functions

static Item_cacheget_cache (const Item *item)
static Item_cacheget_cache (const Item *item, const Item_result type)

Protected Attributes

Itemexample
table_map used_table_map
Fieldcached_field
enum enum_field_types cached_field_type
bool value_cached

Member Function Documentation

bool Item_cache::eq ( const Item item,
bool  binary_cmp 
) const [inline, virtual]

This function is called when:

  • Comparing items in the WHERE clause (when doing where optimization)
  • When trying to find an ORDER BY/GROUP BY item in the SELECT part
  • When matching fields in multiple equality objects (Item_equal)

Reimplemented from Item.

Field* Item_cache::field ( ) [inline]

If this item caches a field value, return pointer to underlying field.

Returns:
Pointer to field, or NULL if this is not a cache for a field value.
Item_cache * Item_cache::get_cache ( const Item item,
const Item_result  type 
) [static]

Get a cache item of given type.

Parameters:
itemvalue to be cached
typerequired type of cache
Returns:
cache item
bool Item_cache::has_value ( ) [inline]

Check if saved item has a non-NULL value. Will cache value of saved item if not already done.

Returns:
TRUE if cached value is non-NULL.
void Item_cache::print ( String str,
enum_query_type  query_type 
) [virtual]

This method is used for to:

  • to generate a view definition query (SELECT-statement);
  • to generate a SQL-query for EXPLAIN EXTENDED;
  • to generate a SQL-query to be shown in INFORMATION_SCHEMA;
  • debug.

For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,

See also:
mysql_register_view().

Reimplemented from Item.

virtual table_map Item_cache::resolved_used_tables ( ) const [inline, virtual]

Return used table information for the level this item is resolved on.

  • For fields, this returns the table the item is resolved from.
  • For all other items, this behaves like used_tables().
Note:
: Use this function with caution. External calls to this function should only be made for class objects derived from Item_ident. Item::resolved_used_tables is for internal use only, in order to process fields underlying a view column reference.

Reimplemented from Item.


Member Data Documentation

Field that this object will get value from. This is used by index-based subquery engines to detect and remove the equality injected by IN->EXISTS transformation.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines