MySQL  8.0.18
Source Code Documentation
item_func.h File Reference
#include <limits.h>
#include <stddef.h>
#include <sys/types.h>
#include <cmath>
#include <functional>
#include "decimal.h"
#include "ft_global.h"
#include "lex_string.h"
#include "m_ctype.h"
#include "my_alloc.h"
#include "my_base.h"
#include "my_compiler.h"
#include "my_dbug.h"
#include "my_inttypes.h"
#include "my_pointer_arithmetic.h"
#include "my_sys.h"
#include "my_table_map.h"
#include "my_thread_local.h"
#include "my_time.h"
#include "mysql/service_mysql_alloc.h"
#include "mysql/udf_registration_types.h"
#include "mysql_com.h"
#include "mysql_time.h"
#include "mysqld_error.h"
#include "sql/enum_query_type.h"
#include "sql/field.h"
#include "sql/handler.h"
#include "sql/item.h"
#include "sql/my_decimal.h"
#include "sql/parse_tree_node_base.h"
#include "sql/set_var.h"
#include "sql/sql_const.h"
#include "sql/sql_udf.h"
#include "sql/table.h"
#include "sql/thr_malloc.h"
#include "sql_string.h"

Go to the source code of this file.

Classes

class  List< T >
 
class  Item_func
 
class  Item_real_func
 
class  Item_func_numhybrid
 
class  Item_func_num1
 
class  Item_num_op
 
class  Item_int_func
 
class  Item_func_connection_id
 
class  Item_typecast_signed
 
class  Item_typecast_unsigned
 
class  Item_typecast_decimal
 
class  Item_typecast_real
 Class used to implement CAST to floating-point data types. More...
 
class  Item_func_additive_op
 
class  Item_func_plus
 
class  Item_func_minus
 
class  Item_func_mul
 
class  Item_func_div
 
class  Item_func_int_div
 
class  Item_func_mod
 
class  Item_func_neg
 
class  Item_func_abs
 
class  Item_dec_func
 
class  Item_func_exp
 
class  Item_func_ln
 
class  Item_func_log
 
class  Item_func_log2
 
class  Item_func_log10
 
class  Item_func_sqrt
 
class  Item_func_pow
 
class  Item_func_acos
 
class  Item_func_asin
 
class  Item_func_atan
 
class  Item_func_cos
 
class  Item_func_sin
 
class  Item_func_tan
 
class  Item_func_cot
 
class  Item_func_integer
 
class  Item_func_int_val
 
class  Item_func_ceiling
 
class  Item_func_floor
 
class  Item_func_round
 
class  Item_func_rand
 
class  Item_func_sign
 
class  Item_func_units
 
class  Item_func_min_max
 
class  Item_func_min
 
class  Item_func_max
 
class  Item_func_rollup_const
 
class  Item_func_length
 
class  Item_func_bit_length
 
class  Item_func_char_length
 
class  Item_func_coercibility
 
class  Item_func_locate
 
class  Item_func_instr
 
class  Item_func_validate_password_strength
 
class  Item_func_field
 
class  Item_func_ascii
 
class  Item_func_ord
 
class  Item_func_find_in_set
 
class  Item_func_bit
 
class  Item_func_bit_two_param
 Base class for all the bit functions that work with two binary arguments: '&', '|', '^'. More...
 
class  Item_func_bit_or
 
class  Item_func_bit_and
 
class  Item_func_bit_xor
 
class  Item_func_bit_count
 
class  Item_func_shift
 
class  Item_func_shift_left
 
class  Item_func_shift_right
 
class  Item_func_bit_neg
 
class  Item_func_last_insert_id
 
class  Item_func_benchmark
 
class  Item_func_sleep
 
class  Item_udf_func
 
class  Item_func_udf_float
 
class  Item_func_udf_int
 
class  Item_func_udf_decimal
 
class  Item_func_udf_str
 
class  Item_func_get_lock
 
class  Item_func_release_lock
 
class  Item_func_release_all_locks
 
class  Item_master_pos_wait
 
class  Item_wait_for_executed_gtid_set
 This class is used for implementing the new wait_for_executed_gtid_set function and the functions related to them. More...
 
class  Item_master_gtid_set_wait
 
class  Item_func_gtid_subset
 
class  Item_func_can_access_database
 
Internal functions used by INFORMATION_SCHEMA implementation to check if user have access to given database/table/column. More...
 
class  Item_func_can_access_table
 
class  Item_func_can_access_trigger
 
class  Item_func_can_access_routine
 
class  Item_func_can_access_event
 
class  Item_func_can_access_resource_group
 
class  Item_func_can_access_view
 
class  Item_func_can_access_column
 
class  Item_func_is_visible_dd_object
 
class  Item_func_internal_table_rows
 
class  Item_func_internal_avg_row_length
 
class  Item_func_internal_data_length
 
class  Item_func_internal_max_data_length
 
class  Item_func_internal_index_length
 
class  Item_func_internal_data_free
 
class  Item_func_internal_auto_increment
 
class  Item_func_internal_checksum
 
class  Item_func_internal_keys_disabled
 
class  Item_func_internal_index_column_cardinality
 
class  Item_func_internal_dd_char_length
 
class  Item_func_internal_get_view_warning_or_error
 
class  Item_func_get_dd_index_sub_part_length
 
class  Item_func_internal_tablespace_id
 
class  Item_func_internal_tablespace_logfile_group_number
 
class  Item_func_internal_tablespace_free_extents
 
class  Item_func_internal_tablespace_total_extents
 
class  Item_func_internal_tablespace_extent_size
 
class  Item_func_internal_tablespace_initial_size
 
class  Item_func_internal_tablespace_maximum_size
 
class  Item_func_internal_tablespace_autoextend_size
 
class  Item_func_internal_tablespace_version
 
class  Item_func_internal_tablespace_data_free
 
class  Item_var_func
 Common class for: Item_func_get_system_var Item_func_get_user_var Item_func_set_user_var. More...
 
class  user_var_entry
 
class  Item_func_set_user_var
 
class  Item_func_get_user_var
 
class  Item_user_var_as_out_param
 
class  Audit_global_variable_get_event
 Class to log audit event MYSQL_AUDIT_GLOBAL_VARIABLE_GET. More...
 
class  Item_func_get_system_var
 
class  Item_func_match
 
class  Item_func_is_free_lock
 
class  Item_func_is_used_lock
 
class  Item_func_row_count
 
class  Item_func_sp
 
class  Item_func_found_rows
 
class  Item_func_uuid_short
 
class  Item_func_version
 

Macros

#define GET_SYS_VAR_CACHE_LONG   1
 
#define GET_SYS_VAR_CACHE_DOUBLE   2
 
#define GET_SYS_VAR_CACHE_STRING   4
 

Functions

bool reject_geometry_args (uint arg_count, Item **args, Item_result_field *me)
 
void unsupported_json_comparison (size_t arg_count, Item **args, const char *msg)
 Go through the arguments of a function and check if any of them are JSON. More...
 
void item_func_sleep_init ()
 
void item_func_sleep_free ()
 
void mysql_ull_cleanup (THD *thd)
 Release all user level locks for this THD. More...
 
void mysql_ull_set_explicit_lock_duration (THD *thd)
 Set explicit duration for metadata locks corresponding to user level locks to protect them from being released at the end of transaction. More...
 
void uuid_short_init ()
 
Itemget_system_var (Parse_context *pc, enum_var_type var_type, LEX_STRING name, LEX_STRING component)
 Return value of an system variable base[.name] as a constant item. More...
 
bool check_reserved_words (const char *name)
 
enum_field_types agg_field_type (Item **items, uint nitems)
 Aggregates field types from the array of items. More...
 
double my_double_round (double value, longlong dec, bool dec_unsigned, bool truncate)
 
bool eval_const_cond (THD *thd, Item *cond, bool *value)
 Evaluate a constant condition, represented by an Item tree. More...
 
Item_fieldget_gc_for_expr (Item_func **func, Field *fld, Item_result type, Field **found=NULL)
 Return new Item_field if given expression matches GC. More...
 
void retrieve_tablespace_statistics (THD *thd, Item **args, bool *null_value)
 Retrieve tablespace statistics from SE. More...
 

Variables

bool volatile mqh_used
 

Macro Definition Documentation

◆ GET_SYS_VAR_CACHE_DOUBLE

#define GET_SYS_VAR_CACHE_DOUBLE   2

◆ GET_SYS_VAR_CACHE_LONG

#define GET_SYS_VAR_CACHE_LONG   1

◆ GET_SYS_VAR_CACHE_STRING

#define GET_SYS_VAR_CACHE_STRING   4

Function Documentation

◆ agg_field_type()

enum_field_types agg_field_type ( Item **  items,
uint  nitems 
)

Aggregates field types from the array of items.

Parameters
[in]itemsarray of items to aggregate the type from
[in]nitemsnumber of items in the array

This function aggregates field types from the array of items. Found type is supposed to be used later as the result field type of a multi-argument function. Aggregation itself is performed by the Field::field_type_merge() function.

Note
The term "aggregation" is used here in the sense of inferring the result type of a function from its argument types.
Returns
aggregated field type.

◆ check_reserved_words()

bool check_reserved_words ( const char *  name)

◆ eval_const_cond()

bool eval_const_cond ( THD thd,
Item cond,
bool value 
)

Evaluate a constant condition, represented by an Item tree.

Parameters
thdThread handler
condThe constant condition to evaluate
[out]valueReturned value, either true or false
Returns
false if evaluation is successful, true otherwise

◆ get_gc_for_expr()

Item_field* get_gc_for_expr ( Item_func **  func,
Field fld,
Item_result  type,
Field **  found 
)

Return new Item_field if given expression matches GC.

See also
substitute_gc()
Parameters
funcExpression to be replaced
fldGCs field
typeResult type to match with Field
[out]foundIf given, just return found field, without Item_field
Returns
item new Item_field for matched GC NULL otherwise

◆ get_system_var()

Item* get_system_var ( Parse_context pc,
enum_var_type  var_type,
LEX_STRING  name,
LEX_STRING  component 
)

Return value of an system variable base[.name] as a constant item.

Parameters
pcCurrent parse context
var_typeglobal / session
nameName of base or system variable
componentComponent.
Note
If component.str = 0 then the variable name is in 'name'
Returns
  • 0 : error
  • # : constant item

◆ item_func_sleep_free()

void item_func_sleep_free ( )

◆ item_func_sleep_init()

void item_func_sleep_init ( )

◆ my_double_round()

double my_double_round ( double  value,
longlong  dec,
bool  dec_unsigned,
bool  truncate 
)

◆ mysql_ull_cleanup()

void mysql_ull_cleanup ( THD thd)

Release all user level locks for this THD.

◆ mysql_ull_set_explicit_lock_duration()

void mysql_ull_set_explicit_lock_duration ( THD thd)

Set explicit duration for metadata locks corresponding to user level locks to protect them from being released at the end of transaction.

◆ reject_geometry_args()

bool reject_geometry_args ( uint  arg_count,
Item **  args,
Item_result_field me 
)

◆ retrieve_tablespace_statistics()

void retrieve_tablespace_statistics ( THD thd,
Item **  args,
bool null_value 
)

Retrieve tablespace statistics from SE.

Parameters
thdThe current thread.
argsList of parameters in following order,
                   - Tablespace_name
                   - Engine_name
                   - Tablespace_se_private_data
[out]null_valueMarked true indicating NULL, if there is no value.
Returns
void

◆ unsupported_json_comparison()

void unsupported_json_comparison ( size_t  arg_count,
Item **  args,
const char *  msg 
)

Go through the arguments of a function and check if any of them are JSON.

If a JSON argument is found, raise a warning saying that this operation is not supported yet. This function is used to notify users that they are comparing JSON values using a mechanism that has not yet been updated to use the JSON comparator. JSON values are typically handled as strings in that case.

Parameters
arg_countthe number of arguments
argsthe arguments to go through looking for JSON values
msgthe message that explains what is not supported

◆ uuid_short_init()

void uuid_short_init ( )

Variable Documentation

◆ mqh_used

bool volatile mqh_used