drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::Item_field Class Reference
Inheritance diagram for drizzled::Item_field:
[legend]
Collaboration diagram for drizzled::Item_field:
[legend]

Public Member Functions

 Item_field (Name_resolution_context *context_arg, const char *db_arg, const char *table_name_arg, const char *field_name_arg)
 Item_field (Session *session, Item_field *item)
 Item_field (Session *session, Name_resolution_context *context_arg, Field *field)
 Item_field (Field *field)
enum Type type () const
bool eq (const Item *item, bool binary_cmp) const
double val_real ()
int64_t val_int ()
type::Decimal * val_decimal (type::Decimal *)
String * val_str (String *)
double val_result ()
int64_t val_int_result ()
String * str_result (String *tmp)
type::Decimal * val_decimal_result (type::Decimal *)
bool val_bool_result ()
void send (plugin::Client *client, String *str_arg)
void reset_field (Field *f)
bool fix_fields (Session *, Item **)
void fix_after_pullout (Select_Lex *new_parent, Item **ref)
void make_field (SendField *tmp_field)
int save_in_field (Field *field, bool no_conversions)
void save_org_in_field (Field *field)
table_map used_tables () const
enum Item_result result_type () const
Item_result cast_to_int_type () const
enum_field_types field_type () const
int64_t val_int_endpoint (bool left_endp, bool *incl_endp)
Field * get_tmp_table_field ()
Field * tmp_table_field (Table *)
bool get_date (type::Time &ltime, uint32_t fuzzydate)
bool get_date_result (type::Time &ltime, uint32_t fuzzydate)
bool get_time (type::Time &ltime)
bool is_null ()
void update_null_value ()
Item * get_tmp_table_item (Session *session)
bool collect_item_field_processor (unsigned char *arg)
bool find_item_in_field_list_processor (unsigned char *arg)
bool register_field_in_read_map (unsigned char *arg)
void cleanup ()
bool result_as_int64_t ()
Item_equal * find_item_equal (COND_EQUAL *cond_equal)
bool subst_argument_checker (unsigned char **arg)
Item * equal_fields_propagator (unsigned char *arg)
bool set_no_const_sub (unsigned char *arg)
Item * replace_equal_field (unsigned char *arg)
uint32_t max_disp_length ()
Item * safe_charset_converter (const charset_info_st *const tocs)
int fix_outer_field (Session *session, Field **field, Item **reference)
virtual Item * update_value_transformer (unsigned char *select_arg)
virtual void print (String *str)
Public Member Functions inherited from drizzled::Item_ident
 Item_ident (Name_resolution_context *context_arg, const char *db_name_arg, const char *table_name_arg, const char *field_name_arg)
 Item_ident (Session *session, Item_ident *item)
const char * full_name () const
void cleanup ()
bool remove_dependence_processor (unsigned char *arg)
virtual bool change_context_processor (unsigned char *cntx)
Public Member Functions inherited from drizzled::Item
bool is_unsigned () const
virtual bool negative () const
 Item ()
 Item (Session *session, Item *item)
void set_name (str_ref arg)
void set_name (const char *arg)
void set_name (const char *str, uint32_t length, const charset_info_st *cs=system_charset_info)
void init_make_field (SendField *tmp_field, enum_field_types type)
Field * make_string_field (Table *table)
void quick_fix_field ()
virtual int save_safe_in_field (Field *field)
virtual enum_field_types string_field_type () const
uint64_t val_uint ()
virtual bool val_bool ()
String * val_string_from_real (String *str)
String * val_string_from_int (String *str)
String * val_string_from_decimal (String *str)
type::Decimal * val_decimal_from_real (type::Decimal *decimal_value)
type::Decimal * val_decimal_from_int (type::Decimal *decimal_value)
type::Decimal * val_decimal_from_string (type::Decimal *decimal_value)
type::Decimal * val_decimal_from_date (type::Decimal *decimal_value)
type::Decimal * val_decimal_from_time (type::Decimal *decimal_value)
int64_t val_int_from_decimal ()
double val_real_from_decimal ()
bool save_time_in_field (Field *field)
bool save_date_in_field (Field *field)
int save_str_value_in_field (Field *field, String *result)
virtual table_map not_null_tables () const
virtual bool basic_const_item () const
virtual Item * clone_item ()
virtual cond_result eq_cmp_result () const
uint32_t float_length (uint32_t decimals_par) const
virtual uint32_t decimal_precision () const
int decimal_int_part () const
virtual bool const_item () const
virtual bool const_during_execution () const
void print_item_w_name (String *)
virtual void update_used_tables ()
virtual void split_sum_func (Session *session, Item **ref_pointer_array, List< Item > &fields)
void split_sum_func (Session *session, Item **ref_pointer_array, List< Item > &fields, Item **ref, bool skip_registered)
virtual void top_level_item (void)
virtual void set_result_field (Field *field)
virtual bool is_result_field (void)
virtual bool is_bool_func (void)
virtual void save_in_result_field (bool no_conversions)
virtual void no_rows_in_result (void)
virtual Item * copy_or_same (Session *session)
virtual Item * copy_andor_structure (Session *session)
virtual Item * real_item (void)
virtual const Item * real_item (void) const
virtual const charset_info_st * compare_collation ()
virtual bool walk (Item_processor processor, bool walk_subquery, unsigned char *arg)
virtual Item * transform (Item_transformer transformer, unsigned char *arg)
virtual Item * compile (Item_analyzer analyzer, unsigned char **arg_p, Item_transformer transformer, unsigned char *arg_t)
virtual void traverse_cond (Cond_traverser traverser, void *arg, traverse_order order)
virtual bool cache_const_expr_analyzer (unsigned char **arg)
virtual Item * cache_const_expr_transformer (unsigned char *arg)
virtual uint32_t cols ()
virtual Item * element_index (uint32_t i)
virtual Item ** addr (uint32_t i)
virtual bool check_cols (uint32_t c)
virtual bool null_inside ()
virtual void bring_value ()
Field * tmp_table_field_from_field_type (Table *table, bool fixed_length)
virtual Item * neg_transformer (Session *session)
void delete_self ()
bool is_datetime ()
virtual bool is_expensive ()
String * check_well_formed_result (String *str, bool send_error=0)
bool eq_by_collation (Item *item, bool binary_cmp, const charset_info_st *const cs)
uint32_t char_to_byte_length_safe (uint32_t char_length_arg, uint32_t mbmaxlen_arg)
uint32_t max_char_length () const
void fix_char_length (uint32_t max_char_length_arg)

Public Attributes

Field * field
Field * result_field
Item_equal * item_equal
bool no_const_subst
uint32_t have_privileges
bool any_privileges
Public Attributes inherited from drizzled::Item_ident
Name_resolution_context * context
const char * db_name
const char * table_name
const char * field_name
bool alias_name_used
uint32_t cached_field_index
TableList * cached_table
Select_Lex * depended_from
Public Attributes inherited from drizzled::Item
String str_value
const char * name
uint32_t name_length
Item * next
uint32_t max_length
int8_t marker
uint8_t decimals
bool fixed
bool maybe_null
bool null_value
bool unsigned_flag
bool with_sum_func
bool is_autogenerated_name
bool with_subselect
DTCollation collation
Item_result cmp_context

Protected Member Functions

void set_field (Field *field)
Protected Member Functions inherited from drizzled::Item
Session & getSession ()

Friends

class Item_default_value
class Item_insert_value
class Select_Lex_Unit

Additional Inherited Members

Public Types inherited from drizzled::Item
enum  Type {
  FIELD_ITEM = 0 , FUNC_ITEM , SUM_FUNC_ITEM , STRING_ITEM ,
  INT_ITEM , REAL_ITEM , NULL_ITEM , VARBIN_ITEM ,
  COPY_STR_ITEM , FIELD_AVG_ITEM , DEFAULT_VALUE_ITEM , PROC_ITEM ,
  COND_ITEM , REF_ITEM , FIELD_STD_ITEM , FIELD_VARIANCE_ITEM ,
  INSERT_VALUE_ITEM , SUBSELECT_ITEM , ROW_ITEM , CACHE_ITEM ,
  TYPE_HOLDER , PARAM_ITEM , BOOLEAN_ITEM , DECIMAL_ITEM
}
enum  traverse_order { T_POSTFIX , T_PREFIX }
enum  cond_result { COND_UNDEF , COND_OK , COND_TRUE , COND_FALSE }
Static Public Member Functions inherited from drizzled::Item
static const charset_info_st * default_charset ()
Static Public Member Functions inherited from drizzled::memory::SqlAlloc
static void * operator new (size_t size)
static void * operator new[] (size_t size)
static void * operator new (size_t size, Root &root)
static void * operator new[] (size_t size, Root &root)
static void * operator new (size_t size, Root *root)
static void * operator new[] (size_t size, Root *root)
static void operator delete (void *)
static void operator delete[] (void *)
static void operator delete (void *, Root &)
static void operator delete[] (void *, Root &)
static void operator delete (void *, Root *)
static void operator delete[] (void *, Root *)
Protected Attributes inherited from drizzled::Item_ident
const char * orig_db_name
const char * orig_table_name
const char * orig_field_name

Detailed Description

Definition at line 30 of file item/field.h.

Constructor & Destructor Documentation

◆ Item_field() [1/4]

drizzled::Item_field::Item_field ( Name_resolution_context * context_arg,
const char * db_arg,
const char * table_name_arg,
const char * field_name_arg )

Definition at line 157 of file item/field.cc.

◆ Item_field() [2/4]

drizzled::Item_field::Item_field ( Session * session,
Item_field * item )

Constructor need to process subselect with temporary tables (see Item)

Definition at line 179 of file item/field.cc.

◆ Item_field() [3/4]

drizzled::Item_field::Item_field ( Session * session,
Name_resolution_context * context_arg,
Field * f )

Constructor used inside setup_wild().

Ensures that field, table, and database names will live as long as Item_field (this is important in prepared statements).

Definition at line 141 of file item/field.cc.

◆ Item_field() [4/4]

drizzled::Item_field::Item_field ( Field * field)

Definition at line 120 of file item/field.cc.

Member Function Documentation

◆ cast_to_int_type()

Item_result drizzled::Item_field::cast_to_int_type ( ) const
virtual

Reimplemented from drizzled::Item.

Definition at line 397 of file item/field.cc.

◆ cleanup()

void drizzled::Item_field::cleanup ( )
virtual

Reimplemented from drizzled::Item.

Definition at line 911 of file item/field.cc.

◆ collect_item_field_processor()

bool drizzled::Item_field::collect_item_field_processor ( unsigned char * arg)
virtual

Store the pointer to this item field into a list if not already there.

The method is used by Item::walk to collect all unique Item_field objects from a tree of Items into a set of items represented as a list.

Item_cond::walk() and Item_func::walk() stop the evaluation of the processor function for its arguments once the processor returns true.Therefore in order to force this method being called for all item arguments in a condition the method must return false.

Parameters
argpointer to a List<Item_field>
Returns
false to force the evaluation of collect_item_field_processor for the subsequent items.

Reimplemented from drizzled::Item.

Definition at line 58 of file item/field.cc.

◆ eq()

bool drizzled::Item_field::eq ( const Item * item,
bool binary_cmp ) const
virtual

Compares this Item to another Item, returning true if Item's are functionally equal.

This function is called when:

  • Comparing items in the WHERE clause (when doing where optimization)
  • When trying to find an order_st BY/GROUP BY item in the SELECT part

Reimplemented from drizzled::Item.

Reimplemented in drizzled::Item_insert_value.

Definition at line 354 of file item/field.cc.

◆ equal_fields_propagator()

Item * drizzled::Item_field::equal_fields_propagator ( unsigned char * arg)
virtual

Set a pointer to the multiple equality the field reference belongs to (if any).

The function looks for a multiple equality containing the field item among those referenced by arg. In the case such equality exists the function does the following. If the found multiple equality contains a constant, then the field reference is substituted for this constant, otherwise it sets a pointer to the multiple equality in the field item.

Parameters
argreference to list of multiple equalities where the field (this object) is to be looked for
Note
This function is supposed to be called as a callback parameter in calls of the compile method.
Returns
  • pointer to the replacing constant item, if the field item was substituted
  • pointer to the field item, otherwise.

Reimplemented from drizzled::Item.

Definition at line 1028 of file item/field.cc.

◆ field_type()

enum_field_types drizzled::Item_field::field_type ( ) const
virtual

Reimplemented from drizzled::Item.

Definition at line 403 of file item/field.cc.

◆ find_item_equal()

Item_equal * drizzled::Item_field::find_item_equal ( COND_EQUAL * cond_equal)

Find a field among specified multiple equalities.

The function first searches the field among multiple equalities of the current level (in the cond_equal->current_level list). If it fails, it continues searching in upper levels accessed through a pointer cond_equal->upper_levels. The search terminates as soon as a multiple equality containing the field is found.

Parameters
cond_equalreference to list of multiple equalities where the field (this object) is to be looked for
Returns
  • First Item_equal containing the field, if success
  • 0, otherwise

Definition at line 948 of file item/field.cc.

◆ find_item_in_field_list_processor()

bool drizzled::Item_field::find_item_in_field_list_processor ( unsigned char * arg)
virtual

Check if an Item_field references some field from a list of fields.

Check whether the Item_field represented by 'this' references any of the fields in the keyparts passed via 'arg'. Used with the method Item::walk() to test whether any keypart in a sequence of keyparts is referenced in an expression.

Parameters
argField being compared, arg must be of type Field
Return values
trueif 'this' references the field 'arg'
falseotherwise

Reimplemented from drizzled::Item.

Definition at line 88 of file item/field.cc.

◆ fix_after_pullout()

void drizzled::Item_field::fix_after_pullout ( Select_Lex * new_parent,
Item ** ref )
virtual

Fix after some tables has been pulled out. Basically re-calculate all attributes that are dependent on the tables.

Reimplemented from drizzled::Item.

Definition at line 409 of file item/field.cc.

◆ fix_fields()

bool drizzled::Item_field::fix_fields ( Session * session,
Item ** reference )
virtual

Resolve the name of a column reference.

The method resolves the column reference represented by 'this' as a column present in one of: FROM clause, SELECT clause, GROUP BY clause of a query Q, or in outer queries that contain Q.

The name resolution algorithm used is (where [T_j] is an optional table name that qualifies the column name):

resolve_column_reference([T_j].col_ref_i)
{
search for a column or derived column named col_ref_i
[in table T_j] in the FROM clause of Q;
if such a column is NOT found AND // Lookup in outer queries.
there are outer queries
{
for each outer query Q_k beginning from the inner-most one
{
search for a column or derived column named col_ref_i
[in table T_j] in the FROM clause of Q_k;
if such a column is not found
Search for a column or derived column named col_ref_i
[in table T_j] in the SELECT and GROUP clauses of Q_k.
}
}
}

Notice that compared to Item_ref::fix_fields, here we first search the FROM clause, and then we search the SELECT and GROUP BY clauses.

Parameters
[in]sessioncurrent thread
[in,out]referenceview column if this item was resolved to a view column
Return values
trueif error
falseon success

Reimplemented from drizzled::Item.

Reimplemented in drizzled::Item_insert_value.

Definition at line 751 of file item/field.cc.

◆ fix_outer_field()

int drizzled::Item_field::fix_outer_field ( Session * session,
Field ** from_field,
Item ** reference )

Resolve the name of an outer select column reference.

The method resolves the column reference represented by 'this' as a column present in outer selects that contain current select.

In prepared statements, because of cache, find_field_in_tables() can resolve fields even if they don't belong to current context. In this case this method only finds appropriate context and marks current select as dependent. The found reference of field should be provided in 'from_field'.

Parameters
[in]sessioncurrent thread
[in,out]from_fieldfound field reference or (Field*)not_found_field
[in,out]referenceview column if this item was resolved to a view column
Note
This is the inner loop of Item_field::fix_fields:
for each outer query Q_k beginning from the inner-most one
{
search for a column or derived column named col_ref_i
[in table T_j] in the FROM clause of Q_k;
if such a column is not found
Search for a column or derived column named col_ref_i
[in table T_j] in the SELECT and GROUP clauses of Q_k.
}
Return values
1column succefully resolved and fix_fields() should continue.
0column fully fixed and fix_fields() should return false
-1error occured

Definition at line 482 of file item/field.cc.

◆ get_date()

bool drizzled::Item_field::get_date ( type::Time & ltime,
uint32_t fuzzydate )
virtual

Get the value of the function as a type::Time structure. As a extra convenience the time structure is reset on error!

Reimplemented from drizzled::Item.

Definition at line 265 of file item/field.cc.

◆ get_date_result()

bool drizzled::Item_field::get_date_result ( type::Time & ltime,
uint32_t fuzzydate )
virtual

Reimplemented from drizzled::Item.

Definition at line 275 of file item/field.cc.

◆ get_time()

bool drizzled::Item_field::get_time ( type::Time & ltime)
virtual

Get time of first argument.

As a extra convenience the time structure is reset on error!

Reimplemented from drizzled::Item.

Definition at line 286 of file item/field.cc.

◆ get_tmp_table_field()

Field * drizzled::Item_field::get_tmp_table_field ( void )
inlinevirtual

Reimplemented from drizzled::Item.

Definition at line 87 of file item/field.h.

◆ get_tmp_table_item()

Item * drizzled::Item_field::get_tmp_table_item ( Session * session)
virtual

Reimplemented from drizzled::Item.

Definition at line 428 of file item/field.cc.

◆ is_null()

bool drizzled::Item_field::is_null ( )
virtual

The method allows to determine nullness of a complex expression without fully evaluating it, instead of calling val/result*() then checking null_value. Used in Item_func_isnull/Item_func_isnotnull and Item_sum_count/Item_sum_count_distinct. Any new item which can be NULL must implement this method.

Reimplemented from drizzled::Item.

Definition at line 422 of file item/field.cc.

◆ make_field()

void drizzled::Item_field::make_field ( SendField * tmp_field)
virtual

Reimplemented from drizzled::Item.

Definition at line 1121 of file item/field.cc.

◆ max_disp_length()

uint32_t drizzled::Item_field::max_disp_length ( )

Definition at line 1114 of file item/field.cc.

◆ print()

void drizzled::Item_field::print ( String * str)
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
register_view().

Reimplemented from drizzled::Item_ident.

Reimplemented in drizzled::Item_default_value, and drizzled::Item_insert_value.

Definition at line 1232 of file item/field.cc.

◆ register_field_in_read_map()

bool drizzled::Item_field::register_field_in_read_map ( unsigned char * arg)
virtual

Reimplemented from drizzled::Item.

Definition at line 110 of file item/field.cc.

◆ replace_equal_field()

Item * drizzled::Item_field::replace_equal_field ( unsigned char * arg)
virtual

Replace an Item_field for an equal Item_field that evaluated earlier (if any).

The function returns a pointer to an item that is taken from the very beginning of the item_equal list which the Item_field object refers to (belongs to) unless item_equal contains a constant item. In this case the function returns this constant item, (if the substitution does not require conversion). If the Item_field object does not refer any Item_equal object 'this' is returned .

Parameters
arga dummy parameter, is not used here
Note
This function is supposed to be called as a callback parameter in calls of the thransformer method.
Returns
  • pointer to a replacement Item_field if there is a better equal item or a pointer to a constant equal item;
  • this - otherwise.

Reimplemented from drizzled::Item.

Definition at line 1094 of file item/field.cc.

◆ reset_field()

void drizzled::Item_field::reset_field ( Field * f)

Reset this item to point to a field from the new temporary table. This is used when we create a new temporary table for each execution of prepared statement.

Definition at line 213 of file item/field.cc.

◆ result_as_int64_t()

bool drizzled::Item_field::result_as_int64_t ( )
virtual

Returns true for Items representing DATE/TIME functions and DATE/TIME table fields. Those Items have result_type()==STRING_RESULT (and not INT_RESULT), but their values should be compared as integers (because the integer representation is more precise than the string one).

Reimplemented from drizzled::Item.

Definition at line 924 of file item/field.cc.

◆ result_type()

enum Item_result drizzled::Item_field::result_type ( ) const
virtual

Reimplemented from drizzled::Item.

Definition at line 391 of file item/field.cc.

◆ safe_charset_converter()

Item * drizzled::Item_field::safe_charset_converter ( const charset_info_st *const tocs)
virtual

Reimplemented from drizzled::Item.

Definition at line 904 of file item/field.cc.

◆ save_in_field()

int drizzled::Item_field::save_in_field ( Field * field,
bool no_conversions )
virtual

Reimplemented from drizzled::Item.

Definition at line 1153 of file item/field.cc.

◆ save_org_in_field()

void drizzled::Item_field::save_org_in_field ( Field * to)
virtual

Set a field's value from a item.

Reimplemented from drizzled::Item.

Definition at line 1138 of file item/field.cc.

◆ send()

void drizzled::Item_field::send ( plugin::Client * client,
String * str )
virtual

This is only called from items that is not of type item_field.

Reimplemented from drizzled::Item.

Definition at line 1171 of file item/field.cc.

◆ set_field()

void drizzled::Item_field::set_field ( Field * field)
protected

Definition at line 191 of file item/field.cc.

◆ set_no_const_sub()

bool drizzled::Item_field::set_no_const_sub ( unsigned char * arg)
virtual

Mark the item to not be part of substitution if it's not a binary item.

See comments in Arg_comparator::set_compare_func() for details.

Reimplemented from drizzled::Item.

Definition at line 1061 of file item/field.cc.

◆ str_result()

String * drizzled::Item_field::str_result ( String * tmp)
virtual

Reimplemented from drizzled::Item.

Definition at line 257 of file item/field.cc.

◆ subst_argument_checker()

bool drizzled::Item_field::subst_argument_checker ( unsigned char ** arg)
virtual

Check whether a field can be substituted by an equal item.

The function checks whether a substitution of the field occurrence for an equal item is valid.

Parameters
arg*arg != NULL <-> the field is in the context where substitution for an equal item is valid
Note
The following statement is not always true:
x=y => F(x)=F(x/y).
This means substitution of an item for an equal item not always yields an equavalent condition. Here's an example:
'a'='a '
(LENGTH('a')=1) != (LENGTH('a ')=2)
Such a substitution is surely valid if either the substituted field is not of a STRING type or if it is an argument of a comparison predicate.
Return values
truesubstitution is valid
falseotherwise

Reimplemented from drizzled::Item.

Definition at line 998 of file item/field.cc.

◆ tmp_table_field()

Field * drizzled::Item_field::tmp_table_field ( Table * )
inlinevirtual

Reimplemented from drizzled::Item.

Definition at line 88 of file item/field.h.

◆ type()

enum Type drizzled::Item_field::type ( ) const
inlinevirtual

Implements drizzled::Item.

Definition at line 64 of file item/field.h.

◆ update_null_value()

void drizzled::Item_field::update_null_value ( )
virtual

Make sure the null_value member has a correct value.

Reimplemented from drizzled::Item.

Definition at line 1177 of file item/field.cc.

◆ update_value_transformer()

Item * drizzled::Item_field::update_value_transformer ( unsigned char * select_arg)
virtual

Reimplemented from drizzled::Item.

Definition at line 1213 of file item/field.cc.

◆ used_tables()

table_map drizzled::Item_field::used_tables ( ) const
virtual

Returns bit map of tables used by item

Reimplemented from drizzled::Item.

Reimplemented in drizzled::Item_insert_value.

Definition at line 381 of file item/field.cc.

◆ val_bool_result()

bool drizzled::Item_field::val_bool_result ( )
virtual

Reimplemented from drizzled::Item.

Definition at line 319 of file item/field.cc.

◆ val_decimal()

type::Decimal * drizzled::Item_field::val_decimal ( type::Decimal * decimal_buffer)
virtual

Return decimal representation of item with fixed point.

Parameters
bufferwhich can be used by Item for returning value (but can be not)
Note

Returned value should not be changed if it is not the same which was passed via argument.

Return values
Returnpointer on type::Decimal (it can be other then passed via argument) if value is not NULL (null_value flag will be reset to false). In case of NULL value it return 0 pointer and set null_value flag to true.

Implements drizzled::Item.

Definition at line 249 of file item/field.cc.

◆ val_decimal_result()

type::Decimal * drizzled::Item_field::val_decimal_result ( type::Decimal * decimal_value)
virtual

Reimplemented from drizzled::Item.

Definition at line 311 of file item/field.cc.

◆ val_int()

int64_t drizzled::Item_field::val_int ( )
virtual

Returns integer representation of item.

Return values
Incase of NULL value return 0 and set null_value flag to true. If value is not null null_value flag will be reset to false.

Implements drizzled::Item.

Definition at line 240 of file item/field.cc.

◆ val_int_endpoint()

int64_t drizzled::Item_field::val_int_endpoint ( bool left_endp,
bool * incl_endp )
virtual

Converts "func_arg $CMP$ const" half-interval into "FUNC(func_arg) $CMP2$ const2"

left_endp false <=> The interval is "x < const" or "x <= const" true <=> The interval is "x > const" or "x >= const"

incl_endp IN true <=> the comparison is '<' or '>' false <=> the comparison is '<=' or '>=' OUT The same but for the "F(x) $CMP$ F(const)" comparison

This function is defined only for unary monotonic functions. The caller supplies the source half-interval

x $CMP$ const

The value of const is supplied implicitly as the value this item's argument, the form of $CMP$ comparison is specified through the function's arguments. The calle returns the result interval

F(x) $CMP2$ F(const)

passing back F(const) as the return value, and the form of $CMP2$ through the out parameter. NULL values are assumed to be comparable and be less than any non-NULL values.

Return values
Theoutput range bound, which equal to the value of val_int()
  • If the value of the function is NULL then the bound is the smallest possible value of INT64_MIN

Reimplemented from drizzled::Item.

Definition at line 435 of file item/field.cc.

◆ val_int_result()

int64_t drizzled::Item_field::val_int_result ( )
virtual

Reimplemented from drizzled::Item.

Definition at line 303 of file item/field.cc.

◆ val_real()

double drizzled::Item_field::val_real ( )
virtual

Returns double precision floating point representation of item.

Return values
Incase of NULL value return 0.0 and set null_value flag to true. If value is not null null_value flag will be reset to false.

Implements drizzled::Item.

Definition at line 231 of file item/field.cc.

◆ val_result()

double drizzled::Item_field::val_result ( )
virtual

Reimplemented from drizzled::Item.

Definition at line 296 of file item/field.cc.

◆ val_str()

String * drizzled::Item_field::val_str ( String * str)
virtual

Return string representation of this item object.

Parameters
anallocated buffer this or any nested Item object can use to store return value of this method.
Note

Buffer passed via argument should only be used if the item itself doesn't have an own String buffer. In case when the item maintains it's own string buffer, it's preferable to return it instead to minimize number of mallocs/memcpys.

The caller of this method can modify returned string, but only in case when it was allocated on heap, (is_alloced() is true). This allows the caller to efficiently use a buffer allocated by a child without having to allocate a buffer of it's own. The buffer, given to val_str() as argument, belongs to the caller and is later used by the caller at it's own choosing.

A few implications from the above:

  • unless you return a string object which only points to your buffer but doesn't manages it you should be ready that it will be modified.
  • even for not allocated strings (is_alloced() == false) the caller can change charset (see Item_func_{typecast/binary}. XXX: is this a bug?
  • still you should try to minimize data copying and return internal object whenever possible.
Return values
Incase of NULL value return 0 (NULL pointer) and set null_value flag to true. If value is not null null_value flag will be reset to false.

Implements drizzled::Item.

Definition at line 221 of file item/field.cc.

◆ Item_default_value

friend class Item_default_value
friend

Definition at line 111 of file item/field.h.

◆ Item_insert_value

friend class Item_insert_value
friend

Definition at line 112 of file item/field.h.

◆ Select_Lex_Unit

friend class Select_Lex_Unit
friend

Definition at line 113 of file item/field.h.

Member Data Documentation

◆ any_privileges

bool drizzled::Item_field::any_privileges

Definition at line 44 of file item/field.h.

◆ field

Field* drizzled::Item_field::field

Definition at line 35 of file item/field.h.

◆ have_privileges

uint32_t drizzled::Item_field::have_privileges

Definition at line 42 of file item/field.h.

◆ item_equal

Item_equal* drizzled::Item_field::item_equal

Definition at line 36 of file item/field.h.

◆ no_const_subst

bool drizzled::Item_field::no_const_subst

Definition at line 37 of file item/field.h.

◆ result_field

Field * drizzled::Item_field::result_field

Definition at line 35 of file item/field.h.


The documentation for this class was generated from the following files: