My Project
|
Public Types | |
enum | Functype { UNKNOWN_FUNC, EQ_FUNC, EQUAL_FUNC, NE_FUNC, LT_FUNC, LE_FUNC, GE_FUNC, GT_FUNC, FT_FUNC, LIKE_FUNC, ISNULL_FUNC, ISNOTNULL_FUNC, COND_AND_FUNC, COND_OR_FUNC, XOR_FUNC, BETWEEN, IN_FUNC, MULT_EQUAL_FUNC, INTERVAL_FUNC, ISNOTNULLTEST_FUNC, SP_EQUALS_FUNC, SP_DISJOINT_FUNC, SP_INTERSECTS_FUNC, SP_TOUCHES_FUNC, SP_CROSSES_FUNC, SP_WITHIN_FUNC, SP_CONTAINS_FUNC, SP_OVERLAPS_FUNC, SP_STARTPOINT, SP_ENDPOINT, SP_EXTERIORRING, SP_POINTN, SP_GEOMETRYN, SP_INTERIORRINGN, NOT_FUNC, NOT_ALL_FUNC, NOW_FUNC, TRIG_COND_FUNC, SUSERVAR_FUNC, GUSERVAR_FUNC, COLLATE_FUNC, EXTRACT_FUNC, CHAR_TYPECAST_FUNC, FUNC_SP, UDF_FUNC, NEG_FUNC, GSYSVAR_FUNC } |
enum | optimize_type { OPTIMIZE_NONE, OPTIMIZE_KEY, OPTIMIZE_OP, OPTIMIZE_NULL, OPTIMIZE_EQUAL } |
Public Member Functions | |
enum Type | type () const |
virtual enum Functype | functype () const |
Item_func (Item *a) | |
Item_func (Item *a, Item *b) | |
Item_func (Item *a, Item *b, Item *c) | |
Item_func (Item *a, Item *b, Item *c, Item *d) | |
Item_func (Item *a, Item *b, Item *c, Item *d, Item *e) | |
Item_func (List< Item > &list) | |
Item_func (THD *thd, Item_func *item) | |
bool | fix_fields (THD *, Item **ref) |
void | fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_select) |
table_map | used_tables () const |
virtual table_map | get_initial_pseudo_tables () const |
table_map | not_null_tables () const |
void | update_used_tables () |
void | set_used_tables (table_map map) |
void | set_not_null_tables (table_map map) |
bool | eq (const Item *item, bool binary_cmp) const |
virtual optimize_type | select_optimize () const |
virtual bool | have_rev_func () const |
virtual Item * | key_item () const |
virtual bool | const_item () const |
Item ** | arguments () const |
void | set_arguments (List< Item > &list) |
uint | argument_count () const |
void | remove_arguments () |
void | split_sum_func (THD *thd, Ref_ptr_array ref_pointer_array, List< Item > &fields) |
virtual void | print (String *str, enum_query_type query_type) |
void | print_op (String *str, enum_query_type query_type) |
void | print_args (String *str, uint from, enum_query_type query_type) |
virtual void | fix_num_length_and_dec () |
void | count_only_length (Item **item, uint nitems) |
void | count_real_length () |
void | count_decimal_length () |
void | count_datetime_length (Item **item, uint nitems) |
bool | count_string_result_length (enum_field_types field_type, Item **item, uint nitems) |
bool | get_arg0_date (MYSQL_TIME *ltime, uint fuzzy_date) |
bool | get_arg0_time (MYSQL_TIME *ltime) |
bool | is_null () |
void | signal_divide_by_null () |
Field * | tmp_table_field () |
Field * | tmp_table_field (TABLE *t_arg) |
Item * | get_tmp_table_item (THD *thd) |
my_decimal * | val_decimal (my_decimal *) |
bool | agg_arg_charsets (DTCollation &c, Item **items, uint nitems, uint flags, int item_sep) |
bool | agg_arg_charsets_for_string_result (DTCollation &c, Item **items, uint nitems, int item_sep=1) |
bool | agg_arg_charsets_for_comparison (DTCollation &c, Item **items, uint nitems, int item_sep=1) |
bool | agg_arg_charsets_for_string_result_with_comparison (DTCollation &c, Item **items, uint nitems, int item_sep=1) |
bool | walk (Item_processor processor, bool walk_subquery, uchar *arg) |
Item * | transform (Item_transformer transformer, uchar *arg) |
Item * | compile (Item_analyzer analyzer, uchar **arg_p, Item_transformer transformer, uchar *arg_t) |
void | traverse_cond (Cond_traverser traverser, void *arg, traverse_order order) |
double | fix_result (double value) |
void | raise_numeric_overflow (const char *type_name) |
double | raise_float_overflow () |
longlong | raise_integer_overflow () |
int | raise_decimal_overflow () |
double | check_float_overflow (double value) |
longlong | check_integer_overflow (longlong value, bool val_unsigned) |
int | check_decimal_overflow (int error) |
bool | has_timestamp_args () |
bool | has_date_args () |
bool | has_time_args () |
bool | has_datetime_args () |
virtual bool | check_valid_arguments_processor (uchar *bool_arg) |
virtual bool | find_function_processor (uchar *arg) |
Public Attributes | |
uint | arg_count |
Protected Attributes | |
Item ** | args |
Item * | tmp_arg [2] |
bool | const_item_cache |
Value used in calculation of result of const_item() | |
uint | allowed_arg_cols |
table_map | used_tables_cache |
Value used in calculation of result of used_tables() | |
table_map | not_null_tables_cache |
Value used in calculation of result of not_null_tables() | |
Friends | |
class | udf_handler |
int Item_func::check_decimal_overflow | ( | int | error | ) | [inline] |
Throw an error if the error code of a DECIMAL operation is E_DEC_OVERFLOW.
double Item_func::check_float_overflow | ( | double | value | ) | [inline] |
Throw an error if the input double number is not finite, i.e. is either +/-INF or NAN.
longlong Item_func::check_integer_overflow | ( | longlong | value, |
bool | val_unsigned | ||
) | [inline] |
Throw an error if the input BIGINT value represented by the (longlong value, bool unsigned flag) pair cannot be returned by the function, i.e. is not compatible with this Item's unsigned_flag.
Item * Item_func::compile | ( | Item_analyzer | analyzer, |
uchar ** | arg_p, | ||
Item_transformer | transformer, | ||
uchar * | arg_t | ||
) | [virtual] |
Compile Item_func object with a processor and a transformer callback functions.
First the function applies the analyzer to the root node of the Item_func object. Then if the analizer succeeeds (returns TRUE) the function recursively applies the compile method to each argument of the Item_func node. If the call of the method for an argument item returns a new item the old item is substituted for a new one. After this the transformer is applied to the root node of the Item_func object.
analyzer | the analyzer callback function to be applied to the nodes of the tree of the object | |
[in,out] | arg_p | parameter to be passed to the processor |
transformer | the transformer callback function to be applied to the nodes of the tree of the object | |
arg_t | parameter to be passed to the transformer |
Reimplemented from Item.
Reimplemented in Item_cond.
void Item_func::count_datetime_length | ( | Item ** | item, |
uint | nitems | ||
) |
Count max_length and decimals for temporal functions.
item | Argument array |
nitems | Number of arguments in the array. |
False | on success, true on error. |
void Item_func::count_decimal_length | ( | ) |
Set max_length/decimals of function if function is fixed point and result length/precision depends on argument ones.
void Item_func::count_only_length | ( | Item ** | item, |
uint | nitems | ||
) |
Set max_length of if it is maximum length of its arguments.
void Item_func::count_real_length | ( | ) |
Set max_length/decimals of function if function is floating point and result length/precision depends on argument ones.
bool Item_func::count_string_result_length | ( | enum_field_types | field_type, |
Item ** | items, | ||
uint | nitems | ||
) |
Calculate max_length and decimals for STRING_RESULT functions.
field_type | Field type. |
items | Argument array. |
nitems | Number of arguments. |
False | on success, true on error. |
bool Item_func::eq | ( | const Item * | item, |
bool | binary_cmp | ||
) | const [virtual] |
This function is called when:
Reimplemented from Item.
Reimplemented in Item_func_match, Item_func_get_system_var, Item_func_get_user_var, Item_extract, Item_date_add_interval, Item_func_date_format, Item_datetime_literal, Item_time_literal, Item_func_set_collation, Item_date_literal, Item_char_typecast, and Item_func_opt_neg.
virtual bool Item_func::find_function_processor | ( | uchar * | arg | ) | [inline, virtual] |
Find a function of a given type
arg | the function type to search (enum Item_func::Functype) |
TRUE | the function type we're searching for is found |
FALSE | the function type wasn't found |
This function can be used (together with Item::walk()) to find functions in an item tree fragment.
Reimplemented from Item.
void Item_func::fix_after_pullout | ( | st_select_lex * | parent_select, |
st_select_lex * | removed_select | ||
) | [virtual] |
Fix after tables have been moved from one select_lex level to the parent level, e.g by semijoin conversion. Basically re-calculate all attributes dependent on the tables.
parent_select | select_lex that tables are moved to. |
removed_select | select_lex that tables are moved away from, child of parent_select. |
Reimplemented from Item.
Reimplemented in Item_cond, Item_func_in, Item_func_if, Item_func_between, and Item_in_optimizer.
virtual table_map Item_func::get_initial_pseudo_tables | ( | ) | const [inline, virtual] |
Returns the pseudo tables depended upon in order to evaluate this function expression. The default implementation returns the empty set.
Reimplemented in Item_func_sp, Item_is_not_null_test, Item_func_sleep, Item_func_sysdate_local, and Item_func_rand.
void Item_func::print | ( | String * | str, |
enum_query_type | query_type | ||
) | [virtual] |
This method is used for to:
For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,
Reimplemented from Item.
Reimplemented in Item_func_match, Item_func_get_system_var, Item_equal, Item_func_get_user_var, Item_func_set_user_var, Item_cond, Item_func_regex, Item_func_isnotnull, Item_func_get_format, Item_func_timestamp_diff, Item_func_add_time, Item_func_in, Item_datetime_typecast, Item_time_typecast, Item_date_typecast, Item_func_case, Item_extract, Item_date_add_interval, Item_func_benchmark, Item_func_bit_neg, Item_func_bit, Item_func_locate, Item_datetime_literal, Item_time_literal, Item_func_set_collation, Item_func_conv_charset, Item_func_nullif, Item_date_literal, Item_func_binary, Item_char_typecast, Item_func_strcmp, Item_func_between, Item_func_int_div, Item_func_format, Item_func_make_set, Item_decimal_typecast, Item_func_unsigned, Item_func_not_all, Item_func_signed, Item_func_trig_cond, Item_num_op, Item_func_not, Item_bool_func2, Item_func_trim, and Item_func_truth.
void Item_func::split_sum_func | ( | THD * | thd, |
Ref_ptr_array | ref_pointer_array, | ||
List< Item > & | fields | ||
) | [virtual] |
See comments in Item_cmp_func::split_sum_func()
Reimplemented from Item.
Reimplemented in Item_cond, and Item_func_make_set.
Item * Item_func::transform | ( | Item_transformer | transformer, |
uchar * | argument | ||
) | [virtual] |
Transform an Item_func object with a transformer callback function.
The function recursively applies the transform method to each argument of the Item_func node. If the call of the method for an argument item returns a new item the old item is substituted for a new one. After this the transformer is applied to the root node of the Item_func object.
transformer | the transformer callback function to be applied to the nodes of the tree of the object |
argument | parameter to be passed to the transformer |
Reimplemented from Item.
Reimplemented in Item_equal, Item_cond, Item_func_make_set, and Item_in_optimizer.