My Project
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Item_copy Class Reference

#include <item.h>

Inheritance diagram for Item_copy:
Item Item_copy_decimal Item_copy_float Item_copy_int Item_copy_string Item_copy_uint

List of all members.

Public Member Functions

virtual void copy ()=0
Itemget_item ()
enum Type type () const
enum_field_types field_type () const
enum Item_result result_type () const
void make_field (Send_field *field)
table_map used_tables () const
bool const_item () const
bool is_null ()
virtual void no_rows_in_result ()
virtual Stringval_str (String *)=0
virtual my_decimalval_decimal (my_decimal *)=0
virtual double val_real ()=0
virtual longlong val_int ()=0
virtual bool get_date (MYSQL_TIME *ltime, uint fuzzydate)=0
virtual bool get_time (MYSQL_TIME *ltime)=0
virtual type_conversion_status save_in_field (Field *field, bool no_conversions)=0

Static Public Member Functions

static Item_copycreate (Item *item)

Protected Member Functions

 Item_copy (Item *i)

Protected Attributes

enum enum_field_types cached_field_type
Itemitem
Item_result cached_result_type

Detailed Description

Base class to implement typed value caching Item classes

Item_copy_ classes are very similar to the corresponding Item_ classes (e.g. Item_copy_int is similar to Item_int) but they add the following additional functionality to Item_ : 1. Nullability 2. Possibility to store the value not only on instantiation time, but also later. Item_copy_ classes are a functionality subset of Item_cache_ classes, as e.g. they don't support comparisons with the original Item as Item_cache_ classes do. Item_copy_ classes are used in GROUP BY calculation. TODO: Item_copy should be made an abstract interface and Item_copy_ classes should inherit both the respective Item_ class and the interface. Ideally we should drop Item_copy_ classes altogether and merge their functionality to Item_cache_ (and these should be made to inherit from Item_).


Constructor & Destructor Documentation

Item_copy::Item_copy ( Item i) [inline, protected]

Constructor of the Item_copy class

stores metadata information about the original class as well as a pointer to it.


Member Function Documentation

virtual void Item_copy::copy ( ) [pure virtual]

Update the cache with the value of the original item

This is the method that updates the cached value. It must be explicitly called by the user of this class to store the value of the orginal item in the cache.

Implemented in Item_copy_decimal, Item_copy_float, Item_copy_int, and Item_copy_string.

Item_copy * Item_copy::create ( Item item) [static]

Factory method to create the appropriate subclass dependent on the type of the original item.

Parameters:
itemthe original item.
virtual type_conversion_status Item_copy::save_in_field ( Field field,
bool  no_conversions 
) [pure virtual]

Save a temporal value in packed longlong format into a Field. Used in optimizer.

Parameters:
OUTfield The field to set the value to.
Return values:
0On success.
>0In error.

Reimplemented from Item.

Implemented in Item_copy_decimal, Item_copy_float, Item_copy_int, and Item_copy_string.

enum Type Item_copy::type ( ) const [inline, virtual]

All of the subclasses should have the same type tag

Implements Item.


Member Data Documentation

enum enum_field_types Item_copy::cached_field_type [protected]

Stores the type of the resulting field that would be used to store the data in the cache. This is to avoid calls to the original item.

Item_result Item_copy::cached_result_type [protected]

Stores the result type of the original item, so it can be returned without calling the original item's method

Item* Item_copy::item [protected]

The original item that is copied


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