MySQL 9.1.0
Source Code Documentation
|
#include <sys/types.h>
#include <climits>
#include <cmath>
#include <cstddef>
#include <functional>
#include "decimal.h"
#include "field_types.h"
#include "ft_global.h"
#include "lex_string.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_table_map.h"
#include "my_thread_local.h"
#include "my_time.h"
#include "mysql/service_mysql_alloc.h"
#include "mysql/strings/m_ctype.h"
#include "mysql/udf_registration_types.h"
#include "mysql_time.h"
#include "mysqld_error.h"
#include "sql-common/my_decimal.h"
#include "sql/enum_query_type.h"
#include "sql/field.h"
#include "sql/handler.h"
#include "sql/item.h"
#include "sql/parse_location.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"
#include "template_utils.h"
Go to the source code of this file.
Macros | |
#define | GET_SYS_VAR_CACHE_LONG 1 |
#define | GET_SYS_VAR_CACHE_DOUBLE 2 |
#define | GET_SYS_VAR_CACHE_STRING 4 |
Functions | |
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 | report_conversion_error (const CHARSET_INFO *to_cs, const char *from, size_t from_length, const CHARSET_INFO *from_cs) |
bool | simplify_string_args (THD *thd, const DTCollation &c, Item **items, uint nitems) |
Simplify the string arguments to a function, if possible. More... | |
String * | eval_string_arg_noinline (const CHARSET_INFO *to_cs, Item *arg, String *buffer) |
Evaluate an argument string and return it in the desired character set. More... | |
String * | eval_string_arg (const CHARSET_INFO *to_cs, Item *arg, String *buffer) |
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 () |
Item * | get_system_variable (Parse_context *pc, enum_var_type scope, const LEX_CSTRING &prefix, const LEX_CSTRING &suffix, bool unsafe_for_replication) |
Create new Item_func_get_system_var object. More... | |
Item * | get_system_variable (Parse_context *pc, enum_var_type scope, const LEX_CSTRING &trivial_name, bool unsafe_for_replication) |
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_field * | get_gc_for_expr (const Item *func, Field *fld, Item_result type, Field **found=nullptr) |
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... | |
bool | is_function_of_type (const Item *item, Item_func::Functype type) |
Checks if "item" is a function of the specified type. More... | |
bool | contains_function_of_type (Item *item, Item_func::Functype type) |
Checks if "item" contains a function of the specified type. More... | |
Variables | |
bool volatile | mqh_used |
#define GET_SYS_VAR_CACHE_DOUBLE 2 |
#define GET_SYS_VAR_CACHE_LONG 1 |
#define GET_SYS_VAR_CACHE_STRING 4 |
enum_field_types agg_field_type | ( | Item ** | items, |
uint | nitems | ||
) |
Aggregates field types from the array of items.
[in] | items | array of items to aggregate the type from |
[in] | nitems | number 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.
bool check_reserved_words | ( | const char * | name | ) |
bool contains_function_of_type | ( | Item * | item, |
Item_func::Functype | type | ||
) |
Checks if "item" contains a function of the specified type.
Evaluate a constant condition, represented by an Item tree.
thd | Thread handler | |
cond | The constant condition to evaluate | |
[out] | value | Returned value, either true or false |
|
inline |
String * eval_string_arg_noinline | ( | const CHARSET_INFO * | to_cs, |
Item * | arg, | ||
String * | buffer | ||
) |
Evaluate an argument string and return it in the desired character set.
Perform character set conversion if needed. Perform character set validation (from a binary string) if needed.
to_cs | The desired character set |
arg | Argument to evaluate as a string value |
buffer | String buffer where argument is evaluated, if necessary |
Item_field * get_gc_for_expr | ( | const Item * | func, |
Field * | fld, | ||
Item_result | type, | ||
Field ** | found | ||
) |
Return new Item_field if given expression matches GC.
func | Expression to be replaced | |
fld | GCs field | |
type | Result type to match with Field | |
[out] | found | If given, just return found field, without Item_field |
Item * get_system_variable | ( | Parse_context * | pc, |
enum_var_type | scope, | ||
const LEX_CSTRING & | prefix, | ||
const LEX_CSTRING & | suffix, | ||
bool | unsafe_for_replication | ||
) |
Create new Item_func_get_system_var object.
pc | Parse context |
scope | Scope of the variable (GLOBAL, SESSION, PERSISTENT ...) |
prefix | Empty LEX_CSTRING{} or the left hand side of the composite variable name, e.g.: component name of the component-registered variable name of MyISAM Multiple Key Cache. |
suffix | Name of the variable (if prefix is empty) or the right hand side of the composite variable name, e.g.: name of the component-registered variable property name of MyISAM Multiple Key Cache variable. |
unsafe_for_replication | force writing this system variable to binlog (if not written yet) |
Create new Item_func_get_system_var object.
pc | Current parse context |
scope | Global / session |
prefix | Optional prefix part of the variable name |
suffix | Trivial name of suffix part of the variable name |
unsafe_for_replication | If true and if the variable is written to a binlog then mark the statement as unsafe. |
|
inline |
bool is_function_of_type | ( | const Item * | item, |
Item_func::Functype | type | ||
) |
Checks if "item" is a function of the specified type.
void item_func_sleep_free | ( | ) |
void item_func_sleep_init | ( | ) |
double my_double_round | ( | double | value, |
longlong | dec, | ||
bool | dec_unsigned, | ||
bool | truncate | ||
) |
void mysql_ull_cleanup | ( | THD * | thd | ) |
Release all user level locks for this THD.
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.
void report_conversion_error | ( | const CHARSET_INFO * | to_cs, |
const char * | from, | ||
size_t | from_length, | ||
const CHARSET_INFO * | from_cs | ||
) |
Retrieve tablespace statistics from SE.
thd | The current thread. | |
args | List of parameters in following order, - Tablespace_name - Engine_name - Tablespace_se_private_data | |
[out] | null_value | Marked true indicating NULL, if there is no value. |
bool simplify_string_args | ( | THD * | thd, |
const DTCollation & | c, | ||
Item ** | args, | ||
uint | nargs | ||
) |
Simplify the string arguments to a function, if possible.
Currently used to substitute const values with character strings in the desired character set. Only used during resolving.
thd | thread handler |
c | Desired character set and collation |
args | Pointer to argument array |
nargs | Number of arguments to process |
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.
arg_count | the number of arguments |
args | the arguments to go through looking for JSON values |
msg | the message that explains what is not supported |
void uuid_short_init | ( | ) |
|
extern |