28#ifndef SQL_LEX_INCLUDED
29#define SQL_LEX_INCLUDED
61#include "mysqld_error.h"
254#define TYPE_ENUM_FUNCTION 1
255#define TYPE_ENUM_PROCEDURE 2
256#define TYPE_ENUM_TRIGGER 3
257#define TYPE_ENUM_PROXY 4
285#define TL_OPTION_UPDATING 0x01
286#define TL_OPTION_IGNORE_LEAVES 0x02
287#define TL_OPTION_ALIAS 0x04
479#define INDEX_HINT_MASK_JOIN (1)
480#define INDEX_HINT_MASK_GROUP (1 << 1)
481#define INDEX_HINT_MASK_ORDER (1 << 2)
483#define INDEX_HINT_MASK_ALL \
484 (INDEX_HINT_MASK_JOIN | INDEX_HINT_MASK_GROUP | INDEX_HINT_MASK_ORDER)
696 THD *thd,
TABLE *dst_table,
bool union_distinct_only);
939 bool optimize(
THD *thd,
TABLE *materialize_destination,
bool create_iterators,
940 bool finalize_access_paths);
1212 bool straight_join =
true;
1215 straight_join &= tbl->straight;
1331 ulong table_options,
1365 ulong want_privilege_next);
1631 const char *prefix);
1736 assert(
join ==
nullptr);
1816 bool optimize(
THD *thd,
bool finalize_access_paths);
2174 bool top,
bool in_sj,
Item **new_conds,
2175 uint *changelog =
nullptr);
2187 Item *join_cond,
bool left_outer,
2188 bool use_inner_join);
2192 bool reject_multiple_rows,
2193 Item *join_condition,
2194 Item *lifted_where_cond);
2202 bool added_card_check);
2252 Item **lifted_where);
2495 std::unique_ptr<malloc_unordered_map<std::string, Sroutine_hash_entry *>>
2548 *
this = std::move(*state);
2877 switch (accessed_table) {
2879 return "STMT_READS_TRANS_TABLE";
2882 return "STMT_READS_NON_TRANS_TABLE";
2885 return "STMT_READS_TEMP_TRANS_TABLE";
2888 return "STMT_READS_TEMP_NON_TRANS_TABLE";
2891 return "STMT_WRITES_TRANS_TABLE";
2894 return "STMT_WRITES_NON_TRANS_TABLE";
2897 return "STMT_WRITES_TEMP_TRANS_TABLE";
2900 return "STMT_WRITES_TEMP_NON_TRANS_TABLE";
2912#define BINLOG_DIRECT_ON \
2917#define BINLOG_DIRECT_OFF \
2922#define TRX_CACHE_EMPTY 0x33
2924#define TRX_CACHE_NOT_EMPTY 0xCC
2926#define IL_LT_REPEATABLE 0xAA
2928#define IL_GTE_REPEATABLE 0x55
2981 bool trx_cache_is_not_empty,
2982 uint tx_isolation) {
2983 bool unsafe =
false;
2985 if (in_multi_stmt_transaction_mode) {
2996 (
"RESULT %02X %02X %02X\n", condition,
3201 unsigned char yyGet() {
3217 unsigned char yyPeek()
const {
3226 unsigned char yyPeekn(
int n)
const {
3370 const char *end_ptr);
3435 const char *alias)
const {
4120 if (
unit ==
nullptr)
return;
4211 tr->restore_properties();
4252 bool copy_db_to(
char const **p_db,
size_t *p_db_length)
const;
4255 return copy_db_to(
const_cast<const char **
>(p_db), p_db_length);
4521 void reset(
const char *found_semicolon,
size_t length) {
4596 static void *
operator new(
size_t size)
noexcept {
4597 return (*THR_MALLOC)->Alloc(size);
4600 const std::nothrow_t &arg
4601 [[maybe_unused]] = std::nothrow)
noexcept {
4604 static void operator delete(
void *ptr [[maybe_unused]],
4605 size_t size [[maybe_unused]]) {
4608 static void operator delete(
4609 void *,
MEM_ROOT *,
const std::nothrow_t &)
noexcept {
4651 &valid_len, &len_error)) {
4654 hexbuf, string_val.
str + valid_len,
4655 static_cast<uint>(std::min<size_t>(string_val.
length - valid_len, 3)));
4676 std::string &invalid_sub_str) {
4681 &valid_len, &len_error)) {
4682 char printable_buff[32];
4684 printable_buff,
sizeof(printable_buff), string_val.
str + valid_len,
4685 static_cast<uint>(std::min<size_t>(string_val.
length - valid_len, 3)),
4687 invalid_sub_str = printable_buff;
4700 Item *item [[maybe_unused]],
4701 bool hidden [[maybe_unused]]) {
4703 if (
std::find(fields.begin(), fields.end(), item) != fields.end()) {
4706 assert(item->hidden == hidden);
4718 const char *legend);
static mysql_service_status_t init()
Component initialization.
Definition: audit_api_message_emit.cc:570
Data describing the table being created by CREATE TABLE or altered by ALTER TABLE.
Definition: sql_alter.h:204
Parser state for CTE subquery parser.
Definition: sql_lex.h:4573
Common_table_expr_parser_state()
Definition: sql_lex.cc:1126
PT_subquery * result
Definition: sql_lex.h:4577
Utility RAII class to save/modify/restore the condition_context information of a query block.
Definition: sql_lex.h:2369
enum_condition_context saved_value
Definition: sql_lex.h:2391
~Condition_context()
Definition: sql_lex.h:2385
Query_block * select
Definition: sql_lex.h:2390
Condition_context(Query_block *select_ptr, enum_condition_context new_type=enum_condition_context::NEITHER)
Definition: sql_lex.h:2371
Parser state for Derived table's condition parser.
Definition: sql_lex.h:4584
Item * result
Definition: sql_lex.h:4588
Derived_expr_parser_state()
Definition: sql_lex.cc:1129
Definition: event_parse_data.h:43
Parser state for single expression parser (.frm/DD stuff)
Definition: sql_lex.h:4563
Expression_parser_state()
Definition: sql_lex.cc:1123
Item * result
Definition: sql_lex.h:4567
Parser state for generated column expression parser (.frm/DD stuff)
Definition: sql_lex.h:4553
Value_generator * result
Definition: sql_lex.h:4557
Gcol_expr_parser_state()
Definition: sql_lex.cc:1120
Definition: sql_lex.h:487
LEX_CSTRING key_name
Definition: sql_lex.h:497
void print(const THD *thd, String *str)
Print an index hint.
Definition: sql_lex.cc:2617
index_clause_map clause
Definition: sql_lex.h:492
enum index_hint_type type
Definition: sql_lex.h:490
Index_hint(const char *str, uint length)
Definition: sql_lex.h:499
Definition: item_cmpfunc.h:2355
Definition: item_subselect.h:412
Definition: item_func.h:3402
Definition: item_func.h:3447
This class is used to implement operations like SET @variable or @variable:= expression.
Definition: item_func.h:3212
A wrapper Item that normally returns its parameter, but becomes NULL when processing rows for rollup.
Definition: item_func.h:1577
A wrapper Item that contains a number of aggregate items, one for each level of rollup (see Item_roll...
Definition: item_sum.h:2698
Definition: item_subselect.h:79
Class Item_sum is the base class used for special expressions that SQL calls 'set functions'.
Definition: item_sum.h:398
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:802
cond_result
Definition: item.h:871
@ COND_UNDEF
Definition: item.h:871
Definition: sql_optimizer.h:125
Definition: key_spec.h:66
Definition: sql_lex.h:3583
LEX_COLUMN(const String &x, const uint &y)
Definition: sql_lex.h:3587
uint rights
Definition: sql_lex.h:3586
String column
Definition: sql_lex.h:3585
Definition: sql_lex.h:3595
List< LEX_USER > * role_list
Definition: sql_lex.h:3604
void cleanup()
Definition: sql_lex.cc:5046
bool grant_as_used
Definition: sql_lex.h:3601
role_enum role_type
Definition: sql_lex.h:3602
LEX_USER * user
Definition: sql_lex.h:3603
LEX_GRANT_AS()
Definition: sql_lex.cc:5053