My Project
|
#include <item.h>
Public Member Functions | |
virtual void | copy ()=0 |
Item * | get_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 String * | val_str (String *)=0 |
virtual my_decimal * | val_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_copy * | create (Item *item) |
Protected Member Functions | |
Item_copy (Item *i) | |
Protected Attributes | |
enum enum_field_types | cached_field_type |
Item * | item |
Item_result | cached_result_type |
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_).
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.
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.
item | the 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.
OUT | field The field to set the value to. |
0 | On success. |
>0 | In 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.
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