MySQL 8.0.40
Source Code Documentation
|
#include "sql/sql_lex.h"
#include <algorithm>
#include <climits>
#include <cstdlib>
#include <initializer_list>
#include "field_types.h"
#include "m_ctype.h"
#include "my_alloc.h"
#include "my_dbug.h"
#include "mysql/mysql_lex_string.h"
#include "mysql/service_mysql_alloc.h"
#include "mysql_version.h"
#include "mysqld_error.h"
#include "prealloced_array.h"
#include "sql/current_thd.h"
#include "sql/derror.h"
#include "sql/item_func.h"
#include "sql/item_subselect.h"
#include "sql/lex_symbol.h"
#include "sql/lexer_yystype.h"
#include "sql/mysqld.h"
#include "sql/nested_join.h"
#include "sql/opt_hints.h"
#include "sql/parse_location.h"
#include "sql/parse_tree_nodes.h"
#include "sql/protocol.h"
#include "sql/select_lex_visitor.h"
#include "sql/sp_head.h"
#include "sql/sql_admin.h"
#include "sql/sql_base.h"
#include "sql/sql_class.h"
#include "sql/sql_cmd.h"
#include "sql/sql_digest_stream.h"
#include "sql/sql_error.h"
#include "sql/sql_insert.h"
#include "sql/sql_lex_hash.h"
#include "sql/sql_lex_hints.h"
#include "sql/sql_optimizer.h"
#include "sql/sql_parse.h"
#include "sql/sql_plugin.h"
#include "sql/sql_profile.h"
#include "sql/sql_show.h"
#include "sql/sql_table.h"
#include "sql/sql_yacc.h"
#include "sql/system_variables.h"
#include "sql/table_function.h"
#include "sql/window.h"
#include "sql_update.h"
#include "template_utils.h"
Macros | |
#define | UNSAFE(a, b, c) |
Typedefs | |
typedef Prealloced_array< Table_ref *, 8 > | Table_array |
Functions | |
int | HINT_PARSER_parse (THD *thd, Hint_scanner *scanner, PT_hint_list **ret) |
static int | lex_one_token (Lexer_yystype *yylval, THD *thd) |
bool | lex_init () |
void | lex_free () |
bool | lex_start (THD *thd) |
Call lex_start() before every query that is to be prepared and executed. More... | |
void | lex_end (LEX *lex) |
Call this function after preparation and execution of a query. More... | |
static bool | consume_optimizer_hints (Lex_input_stream *lip) |
static int | find_keyword (Lex_input_stream *lip, uint len, bool function) |
bool | is_keyword (const char *name, size_t len) |
bool | is_lex_native_function (const LEX_STRING *name) |
Check if name is a sql function. More... | |
static LEX_STRING | get_token (Lex_input_stream *lip, uint skip, uint length) |
static LEX_STRING | get_quoted_token (Lex_input_stream *lip, uint skip, uint length, char quote) |
static char * | get_text (Lex_input_stream *lip, int pre_skip, int post_skip) |
static uint | int_token (const char *str, uint length) |
static bool | consume_comment (Lex_input_stream *lip, int remaining_recursions_permitted) |
Given a stream that is advanced to the first contained character in an open comment, consume the comment. More... | |
int | MYSQLlex (YYSTYPE *yacc_yylval, YYLTYPE *yylloc, THD *thd) |
yylex() function implementation for the main parser More... | |
void | trim_whitespace (const CHARSET_INFO *cs, LEX_STRING *str) |
void | print_derived_column_names (const THD *thd, String *str, const Create_col_name_list *column_names) |
Prints into 'str' a comma-separated list of column names, enclosed in parenthesis. More... | |
void | print_set_operation (const THD *thd, Query_term *op, String *str, int level, enum_query_type query_type) |
static void | print_table_array (const THD *thd, String *str, const Table_array &tables, enum_query_type query_type) |
static void | print_join (const THD *thd, String *str, mem_root_deque< Table_ref * > *tables, enum_query_type query_type) |
Print joins from the FROM clause. More... | |
bool | db_is_default_db (const char *db, size_t db_len, const THD *thd) |
static enum_walk | get_walk_flags (const Select_lex_visitor *visitor) |
bool | walk_item (Item *item, Select_lex_visitor *visitor) |
bool | accept_for_order (SQL_I_List< ORDER > orders, Select_lex_visitor *visitor) |
bool | accept_for_join (mem_root_deque< Table_ref * > *tables, Select_lex_visitor *visitor) |
bool | accept_table (Table_ref *t, Select_lex_visitor *visitor) |
static enum_explain_type | setop2result (Query_term *qt) |
static bool | get_optimizable_join_conditions (THD *thd, mem_root_deque< Table_ref * > &join_list) |
Helper function which handles the "ON conditions" part of Query_block::get_optimizable_conditions(). More... | |
static bool | walk_join_condition (mem_root_deque< Table_ref * > *tables, Item_processor processor, enum_walk walk, uchar *arg) |
Apply walk() processor to join conditions. More... | |
static void | unsafe_mixed_statement (LEX::enum_stmt_accessed_table a, LEX::enum_stmt_accessed_table b, uint condition) |
void | binlog_unsafe_map_init () |
Variables | |
const LEX_STRING | null_lex_str = {nullptr, 0} |
LEX_STRING constant for null-string to be used in parser and other places. More... | |
const char * | index_hint_type_name [] |
static const char * | long_str = "2147483647" |
static const uint | long_len = 10 |
static const char * | signed_long_str = "-2147483648" |
static const char * | longlong_str = "9223372036854775807" |
static const uint | longlong_len = 19 |
static const char * | signed_longlong_str = "-9223372036854775808" |
static const uint | signed_longlong_len = 19 |
static const char * | unsigned_longlong_str = "18446744073709551615" |
static const uint | unsigned_longlong_len = 20 |
uint | binlog_unsafe_map [256] |
#define UNSAFE | ( | a, | |
b, | |||
c | |||
) |
typedef Prealloced_array<Table_ref *, 8> Table_array |
bool accept_for_join | ( | mem_root_deque< Table_ref * > * | tables, |
Select_lex_visitor * | visitor | ||
) |
bool accept_for_order | ( | SQL_I_List< ORDER > | orders, |
Select_lex_visitor * | visitor | ||
) |
bool accept_table | ( | Table_ref * | t, |
Select_lex_visitor * | visitor | ||
) |
|
static |
Given a stream that is advanced to the first contained character in an open comment, consume the comment.
Optionally, if we are allowed, recurse so that we understand comments within this current comment.
At this level, we do not support version-condition comments. We might have been called with having just passed one in the stream, though. In that case, we probably want to tolerate mundane comments inside. Thus, the case for recursion.
Whether | EOF reached before comment is closed. |
|
static |
|
static |
|
static |
Helper function which handles the "ON conditions" part of Query_block::get_optimizable_conditions().
|
static |
|
static |
|
static |
|
static |
int HINT_PARSER_parse | ( | THD * | thd, |
Hint_scanner * | scanner, | ||
PT_hint_list ** | ret | ||
) |
|
static |
|
static |
Print joins from the FROM clause.
thd | thread handler |
str | string where table should be printed |
tables | list of tables in join |
query_type | type of the query is being generated |
void print_set_operation | ( | const THD * | thd, |
Query_term * | op, | ||
String * | str, | ||
int | level, | ||
enum_query_type | query_type | ||
) |
|
static |
|
static |
|
static |
bool walk_item | ( | Item * | item, |
Select_lex_visitor * | visitor | ||
) |
|
static |
Apply walk() processor to join conditions.
JOINs may be nested. Walk nested joins recursively to apply the processor.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |