|
drizzle
C++ MySQL-protocol-compatible database server
|
Public Types | |
| enum | Functype { UNKNOWN_FUNC , EQ_FUNC , EQUAL_FUNC , NE_FUNC , LT_FUNC , LE_FUNC , GE_FUNC , GT_FUNC , LIKE_FUNC , ISNULL_FUNC , ISNOTNULL_FUNC , COND_AND_FUNC , COND_OR_FUNC , COND_XOR_FUNC , BETWEEN , IN_FUNC , MULT_EQUAL_FUNC , INTERVAL_FUNC , ISNOTNULLTEST_FUNC , NOT_FUNC , NOT_ALL_FUNC , NOW_FUNC , TRIG_COND_FUNC , SUSERVAR_FUNC , GUSERVAR_FUNC , COLLATE_FUNC , EXTRACT_FUNC , CHAR_TYPECAST_FUNC , FUNC_SP , NEG_FUNC } |
| enum | optimize_type { OPTIMIZE_NONE , OPTIMIZE_KEY , OPTIMIZE_OP , OPTIMIZE_NULL , OPTIMIZE_EQUAL } |
| 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 } |
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 (Session *session, Item_func *item) | |
| bool | fix_fields (Session *, Item **ref) |
| void | fix_after_pullout (Select_Lex *new_parent, Item **ref) |
| table_map | used_tables () const |
| table_map | not_null_tables () const |
| void | update_used_tables () |
| 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 const char * | func_name () const |
| virtual bool | const_item () const |
| Item ** | arguments () const |
| void | set_arguments (List< Item > &list) |
| uint32_t | argument_count () const |
| void | remove_arguments () |
| virtual bool | check_argument_count (int) |
| virtual void | split_sum_func (Session *session, Item **ref_pointer_array, List< Item > &fields) |
| virtual void | print (String *str) |
| void | print_op (String *str) |
| void | print_args (String *str, uint32_t from) |
| virtual void | fix_num_length_and_dec () |
| void | count_only_length () |
| void | count_real_length () |
| void | count_decimal_length () |
| bool | get_arg0_date (type::Time <ime, uint32_t fuzzy_date) |
| bool | get_arg0_time (type::Time <ime) |
| bool | is_null () |
| virtual bool | deterministic () const |
| void | signal_divide_by_null () |
| virtual Field * | tmp_table_field () |
| virtual Field * | tmp_table_field (Table *t_arg) |
| Item * | get_tmp_table_item (Session *session) |
| type::Decimal * | val_decimal (type::Decimal *) |
| bool | agg_arg_collations (DTCollation &c, Item **items, uint32_t nitems, uint32_t flags) |
| bool | agg_arg_collations_for_comparison (DTCollation &c, Item **items, uint32_t nitems, uint32_t flags) |
| bool | agg_arg_charsets (DTCollation &c, Item **items, uint32_t nitems, uint32_t flags, int item_sep) |
| bool | walk (Item_processor processor, bool walk_subquery, unsigned char *arg) |
| Item * | transform (Item_transformer transformer, unsigned char *arg) |
| Item * | compile (Item_analyzer analyzer, unsigned char **arg_p, Item_transformer transformer, unsigned char *arg_t) |
| void | traverse_cond (Cond_traverser traverser, void *arg, traverse_order order) |
| double | fix_result (double value) |
| void | split_sum_func (Session *session, Item **ref_pointer_array, List< Item > &fields, Item **ref, bool skip_registered) |
| Public Member Functions inherited from drizzled::Item_result_field | |
| Item_result_field (Session *session, Item_result_field *item) | |
| Field * | get_tmp_table_field () |
| Field * | tmp_table_field (Table *) |
| table_map | used_tables () const |
| virtual void | fix_length_and_dec ()=0 |
| void | set_result_field (Field *field) |
| bool | is_result_field () |
| void | save_in_result_field (bool no_conversions) |
| void | cleanup () |
| 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) |
| virtual void | make_field (SendField *field) |
| Field * | make_string_field (Table *table) |
| void | quick_fix_field () |
| virtual int | save_in_field (Field *field, bool no_conversions) |
| virtual void | save_org_in_field (Field *field) |
| virtual int | save_safe_in_field (Field *field) |
| virtual void | send (plugin::Client *client, String *str) |
| virtual Item_result | result_type () const |
| virtual Item_result | cast_to_int_type () const |
| virtual enum_field_types | string_field_type () const |
| virtual enum_field_types | field_type () const |
| virtual int64_t | val_int_endpoint (bool left_endp, bool *incl_endp) |
| virtual double | val_real ()=0 |
| virtual int64_t | val_int ()=0 |
| uint64_t | val_uint () |
| virtual String * | val_str (String *str)=0 |
| 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 const char * | full_name (void) const |
| virtual double | val_result () |
| virtual int64_t | val_int_result () |
| virtual String * | str_result (String *tmp) |
| virtual type::Decimal * | val_decimal_result (type::Decimal *val) |
| virtual bool | val_bool_result () |
| 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_during_execution () const |
| void | print_item_w_name (String *) |
| void | split_sum_func (Session *session, Item **ref_pointer_array, List< Item > &fields, Item **ref, bool skip_registered) |
| virtual bool | get_date (type::Time <ime, uint32_t fuzzydate) |
| virtual bool | get_time (type::Time <ime) |
| virtual bool | get_date_result (type::Time <ime, uint32_t fuzzydate) |
| virtual void | update_null_value () |
| virtual void | top_level_item (void) |
| virtual bool | is_bool_func (void) |
| 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 | remove_dependence_processor (unsigned char *arg) |
| virtual bool | collect_item_field_processor (unsigned char *arg) |
| virtual bool | find_item_in_field_list_processor (unsigned char *arg) |
| virtual bool | change_context_processor (unsigned char *context) |
| virtual bool | register_field_in_read_map (unsigned char *arg) |
| virtual bool | subst_argument_checker (unsigned char **arg) |
| virtual bool | cache_const_expr_analyzer (unsigned char **arg) |
| virtual Item * | cache_const_expr_transformer (unsigned char *arg) |
| virtual Item * | equal_fields_propagator (unsigned char *arg) |
| virtual bool | set_no_const_sub (unsigned char *arg) |
| virtual Item * | replace_equal_field (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) |
| virtual Item * | update_value_transformer (unsigned char *select_arg) |
| virtual Item * | safe_charset_converter (const charset_info_st *const tocs) |
| void | delete_self () |
| virtual bool | result_as_int64_t () |
| 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 | |
| uint32_t | arg_count |
| table_map | used_tables_cache |
| table_map | not_null_tables_cache |
| bool | const_item_cache |
| Public Attributes inherited from drizzled::Item_result_field | |
| Field * | result_field |
| 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 Attributes | |
| Item ** | args |
| Item * | tmp_arg [2] |
| uint32_t | allowed_arg_cols |
Additional Inherited Members | |
| 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 Member Functions inherited from drizzled::Item | |
| Session & | getSession () |
Definition at line 37 of file function/func.h.
| enum drizzled::Item_func::Functype |
Definition at line 54 of file function/func.h.
| enum drizzled::Item_func::optimize_type |
Definition at line 65 of file function/func.h.
|
inlinevirtual |
Definition at line 69 of file function/func.h.
| drizzled::Item_func::Item_func | ( | Session * | session, |
| Item_func * | item ) |
| bool drizzled::Item_func::agg_arg_charsets | ( | DTCollation & | c, |
| Item ** | items, | ||
| uint32_t | nitems, | ||
| uint32_t | flags, | ||
| int | item_sep ) |
| bool drizzled::Item_func::agg_arg_collations | ( | DTCollation & | c, |
| Item ** | items, | ||
| uint32_t | nitems, | ||
| uint32_t | flags ) |
| bool drizzled::Item_func::agg_arg_collations_for_comparison | ( | DTCollation & | c, |
| Item ** | items, | ||
| uint32_t | nitems, | ||
| uint32_t | flags ) |
|
inline |
Definition at line 111 of file function/func.h.
|
inline |
Definition at line 109 of file function/func.h.
|
inlinevirtual |
Check if the UDF supports the number of arguments passed in
| number | of args |
Reimplemented in AsciiFunction, BenchmarkFunction, CharLengthFunction, ClearEngineStateHistoryFunction, CoercibilityFunction, ConnectionIdFunction, Crc32Function, debug::Assert, drizzle_plugin::js::JsFunction, drizzle_plugin::MySQLPassword, drizzle_plugin::syslog::udf::Syslog, drizzled::Item_func_abs, drizzled::Item_func_acos, drizzled::Item_func_asin, drizzled::Item_func_atan, drizzled::Item_func_ceiling, drizzled::Item_func_cos, drizzled::Item_func_elt, drizzled::Item_func_exp, drizzled::Item_func_floor, drizzled::Item_func_format, drizzled::Item_func_ln, drizzled::Item_func_log10, drizzled::Item_func_log2, drizzled::Item_func_log, drizzled::Item_func_ord, drizzled::Item_func_pow, drizzled::Item_func_quote, drizzled::Item_func_sin, drizzled::Item_func_sqrt, drizzled::string_functions::Regex, drizzled::utility_functions::Assert, drizzled::utility_functions::Execute, drizzled::utility_functions::Kill, drizzled::utility_functions::ResultType, drizzled::utility_functions::Typeof, HexFunction, HttpGetFunction, HttpPostFunction, Item_func_compress, Item_func_sleep, Item_func_uncompress, Item_func_uncompressed_length, LengthFunction, Md5Function, MemcachedAdd, MemcachedAddByKey, MemcachedAppend, MemcachedAppendByKey, MemcachedCas, MemcachedCasByKey, MemcachedDelete, MemcachedDeleteByKey, MemcachedPrepend, MemcachedPrependByKey, MemcachedReplace, MemcachedReplaceByKey, MemcachedServersSet, MemcachedSet, MemcachedSetByKey, plugin::catalog::functions::Create, plugin::catalog::functions::Drop, plugin::catalog::functions::Lock, plugin::catalog::functions::Unlock, RandFunction, ReverseFunction, SEAPITesterErrorInjectFunc, ShowSchemaProtoFunction, SubstrFunction, SubstrIndexFunction, UnHexFunction, user_locks::barriers::CreateBarrier, user_locks::barriers::Release, user_locks::barriers::Signal, user_locks::barriers::Wait, user_locks::barriers::WaitUntil, user_locks::GetLock, user_locks::IsFreeLock, user_locks::IsUsedLock, user_locks::locks::ReleaseAndWait, user_locks::locks::WaitFor, user_locks::ReleaseLock, user_locks::ReleaseLocks, VersionFunction, and WiredTigerCheckpointFunction.
Definition at line 118 of file function/func.h.
|
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 drizzled::Item.
|
inlinevirtual |
Returns true if this is constant (during query execution, i.e. its value will not change until next fix_fields) and its value is known.
Reimplemented from drizzled::Item.
Reimplemented in drizzled::Item_func_get_user_var, drizzled::Item_func_rollup_const, drizzled::Item_func_sysdate_local, drizzled::Item_func_trig_cond, and RandFunction.
Definition at line 108 of file function/func.h.
| void drizzled::Item_func::count_decimal_length | ( | ) |
| void drizzled::Item_func::count_only_length | ( | ) |
| void drizzled::Item_func::count_real_length | ( | ) |
|
inlinevirtual |
Definition at line 135 of file function/func.h.
|
virtual |
Compares this Item to another Item, returning true if Item's are functionally equal.
This function is called when:
Reimplemented from drizzled::Item.
Reimplemented in drizzled::Item_func_date_format, drizzled::Item_func_get_user_var, drizzled::Item_func_opt_neg, and drizzled::Item_func_set_collation.
|
virtual |
Fix after some tables has been pulled out. Basically re-calculate all attributes that are dependent on the tables.
Reimplemented from drizzled::Item.
Reimplemented from drizzled::Item.
Reimplemented in drizzled::Item_func_between, drizzled::Item_func_if, and drizzled::Item_func_in.
|
virtual |
|
inlinevirtual |
Definition at line 107 of file function/func.h.
|
inlinevirtual |
Definition at line 68 of file function/func.h.
| bool drizzled::Item_func::get_arg0_date | ( | type::Time & | ltime, |
| uint32_t | fuzzy_date ) |
| bool drizzled::Item_func::get_arg0_time | ( | type::Time & | ltime | ) |
Reimplemented from drizzled::Item.
|
inlinevirtual |
Definition at line 95 of file function/func.h.
|
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.
Reimplemented in drizzled::Item_func_nullif, drizzled::Item_func_numhybrid, and drizzled::Item_in_optimizer.
|
inlinevirtual |
Definition at line 96 of file function/func.h.
|
virtual |
Return table map of tables that can't be NULL tables (tables that are used in a context where if they would contain a NULL row generated by a LEFT or RIGHT join, the item would not be true). This expression is used on WHERE item to determinate if a LEFT JOIN can be converted to a normal join. Generally this function should return used_tables() if the function would return null if any of the arguments are null As this is only used in the beginning of optimization, the value don't have to be updated in update_used_tables()
Reimplemented from drizzled::Item.
Reimplemented in drizzled::Item_func_case, drizzled::Item_func_coalesce, drizzled::Item_func_collation, drizzled::Item_func_concat_ws, drizzled::Item_func_equal, drizzled::Item_func_isnotnull, drizzled::Item_func_isnull, and drizzled::Item_func_nullif.
|
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 drizzled::Item.
Reimplemented in BenchmarkFunction, drizzled::function::bit::Bit, drizzled::function::bit::Neg, drizzled::function::cast::Boolean, drizzled::function::cast::Signed, drizzled::function::cast::Unsigned, drizzled::Item_bool_func2, drizzled::Item_char_typecast, drizzled::Item_cond, drizzled::Item_date_add_interval, drizzled::Item_decimal_typecast, drizzled::Item_equal, drizzled::Item_extract, drizzled::Item_func_between, drizzled::Item_func_binary, drizzled::Item_func_case, drizzled::Item_func_conv_charset, drizzled::Item_func_format, drizzled::Item_func_get_user_var, drizzled::Item_func_in, drizzled::Item_func_int_div, drizzled::Item_func_isnotnull, drizzled::Item_func_locate, drizzled::Item_func_make_set, drizzled::Item_func_not, drizzled::Item_func_not_all, drizzled::Item_func_nullif, drizzled::Item_func_set_collation, drizzled::Item_func_set_user_var, drizzled::Item_func_strcmp, drizzled::Item_func_timestamp_diff, drizzled::Item_func_trim, drizzled::Item_func_truth, drizzled::Item_num_op, and drizzled::Item_typecast.
| void drizzled::Item_func::print_args | ( | String * | str, |
| uint32_t | from ) |
|
inline |
Definition at line 112 of file function/func.h.
|
inlinevirtual |
Reimplemented in drizzled::Item_func_like.
Definition at line 94 of file function/func.h.
|
virtual |
See comments in Item_cmp_func::split_sum_func()
Reimplemented from drizzled::Item.
Reimplemented in drizzled::Item_cond, and drizzled::Item_func_make_set.
| void drizzled::Item::split_sum_func | ( | Session * | session, |
| Item ** | ref_pointer_array, | ||
| List< Item > & | fields, | ||
| Item ** | ref, | ||
| bool | skip_registered ) |
Move SUM items out from item tree and replace with reference.
| session | Thread handler |
| ref_pointer_array | Pointer to array of reference fields |
| fields | All fields in select |
| ref | Pointer to item |
| skip_registered | <=> function be must skipped for registered SUM items |
All found SUM items are added FIRST in the fields list and we replace the item with a reference.
session->fatal_error() may be called if we are out of memory
|
inlinevirtual |
Definition at line 142 of file function/func.h.
Reimplemented from drizzled::Item.
|
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 drizzled::Item.
Reimplemented in drizzled::Item_func_make_set, and drizzled::Item_in_optimizer.
|
virtual |
Reimplemented from drizzled::Item.
|
inlinevirtual |
Implements drizzled::Item.
Definition at line 67 of file function/func.h.
|
virtual |
Reimplemented from drizzled::Item.
Reimplemented in drizzled::Item_is_not_null_test.
|
virtual |
Returns bit map of tables used by item
Reimplemented from drizzled::Item.
Reimplemented in drizzled::Item_func_get_user_var, drizzled::Item_func_trig_cond, and drizzled::Item_is_not_null_test.
|
virtual |
Return decimal representation of item with fixed point.
| buffer | which can be used by Item for returning value (but can be not) |
Returned value should not be changed if it is not the same which was passed via argument.
| Return | pointer 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.
Reimplemented in drizzled::function::cast::Time, drizzled::Item_func_case, drizzled::Item_func_get_user_var, drizzled::Item_func_if, drizzled::Item_func_min_max, drizzled::Item_func_nullif, drizzled::Item_func_numhybrid, drizzled::Item_func_rollup_const, drizzled::Item_func_set_user_var, drizzled::Item_real_func, drizzled::Item_str_func, and drizzled::Item_time.
|
virtual |
Reimplemented from drizzled::Item.
|
protected |
Definition at line 45 of file function/func.h.
| uint32_t drizzled::Item_func::arg_count |
Definition at line 51 of file function/func.h.
|
protected |
Definition at line 40 of file function/func.h.
| bool drizzled::Item_func::const_item_cache |
Definition at line 53 of file function/func.h.
| table_map drizzled::Item_func::not_null_tables_cache |
Definition at line 52 of file function/func.h.
|
protected |
Definition at line 40 of file function/func.h.
| table_map drizzled::Item_func::used_tables_cache |
Definition at line 52 of file function/func.h.