28#ifndef SQL_LEX_INCLUDED
29#define SQL_LEX_INCLUDED
61#include "mysqld_error.h"
255#define TYPE_ENUM_FUNCTION 1
256#define TYPE_ENUM_PROCEDURE 2
257#define TYPE_ENUM_TRIGGER 3
258#define TYPE_ENUM_PROXY 4
286#define TL_OPTION_UPDATING 0x01
287#define TL_OPTION_IGNORE_LEAVES 0x02
288#define TL_OPTION_ALIAS 0x04
477#define INDEX_HINT_MASK_JOIN (1)
478#define INDEX_HINT_MASK_GROUP (1 << 1)
479#define INDEX_HINT_MASK_ORDER (1 << 2)
481#define INDEX_HINT_MASK_ALL \
482 (INDEX_HINT_MASK_JOIN | INDEX_HINT_MASK_GROUP | INDEX_HINT_MASK_ORDER)
662 for (
auto qt : query_terms<>()) {
663 if (qt->query_block() == qb)
return qt;
703 auto const setop = down_cast<Query_term_set_op *>(
m_query_term);
704 if (setop->m_last_distinct > 0)
705 return setop->m_children[setop->m_last_distinct]->query_block();
712 return down_cast<Query_term_set_op *>(
m_query_term)->m_last_distinct > 0;
956 bool optimize(
THD *thd,
TABLE *materialize_destination,
bool create_iterators,
957 bool finalize_access_paths);
1342 ulong table_options,
1376 ulong want_privilege_next);
1642 const char *prefix);
1719 void cleanup(
bool full)
override;
1747 assert(
join ==
nullptr);
1827 bool optimize(
THD *thd,
bool finalize_access_paths);
2188 bool top,
bool in_sj,
Item **new_conds,
2189 uint *changelog =
nullptr);
2201 Item *join_cond,
bool left_outer,
2202 bool use_inner_join);
2206 bool reject_multiple_rows,
2207 Item *join_condition,
2208 Item *lifted_where_cond);
2216 bool added_card_check);
2266 Item **lifted_where);
2388 qt = down_cast<Query_term_unary *>(qt)->m_children[0];
2395 qt = down_cast<Query_term_unary *>(qt)->m_children[0];
2528 std::unique_ptr<malloc_unordered_map<std::string, Sroutine_hash_entry *>>
2581 *
this = std::move(*state);
2919 switch (accessed_table) {
2921 return "STMT_READS_TRANS_TABLE";
2924 return "STMT_READS_NON_TRANS_TABLE";
2927 return "STMT_READS_TEMP_TRANS_TABLE";
2930 return "STMT_READS_TEMP_NON_TRANS_TABLE";
2933 return "STMT_WRITES_TRANS_TABLE";
2936 return "STMT_WRITES_NON_TRANS_TABLE";
2939 return "STMT_WRITES_TEMP_TRANS_TABLE";
2942 return "STMT_WRITES_TEMP_NON_TRANS_TABLE";
2954#define BINLOG_DIRECT_ON \
2959#define BINLOG_DIRECT_OFF \
2964#define TRX_CACHE_EMPTY 0x33
2966#define TRX_CACHE_NOT_EMPTY 0xCC
2968#define IL_LT_REPEATABLE 0xAA
2970#define IL_GTE_REPEATABLE 0x55
3023 bool trx_cache_is_not_empty,
3024 uint tx_isolation) {
3025 bool unsafe =
false;
3027 if (in_multi_stmt_transaction_mode) {
3038 (
"RESULT %02X %02X %02X\n", condition,
3243 unsigned char yyGet() {
3259 unsigned char yyPeek()
const {
3268 unsigned char yyPeekn(
int n)
const {
3412 const char *end_ptr);
3477 const char *alias)
const {
4175 if (
unit ==
nullptr)
return;
4266 tr->restore_properties();
4307 bool copy_db_to(
char const **p_db,
size_t *p_db_length)
const;
4310 return copy_db_to(
const_cast<const char **
>(p_db), p_db_length);
4576 void reset(
const char *found_semicolon,
size_t length) {
4651 static void *
operator new(
size_t size)
noexcept {
4652 return (*THR_MALLOC)->Alloc(size);
4655 const std::nothrow_t &arg
4656 [[maybe_unused]] = std::nothrow)
noexcept {
4659 static void operator delete(
void *ptr [[maybe_unused]],
4660 size_t size [[maybe_unused]]) {
4663 static void operator delete(
4664 void *,
MEM_ROOT *,
const std::nothrow_t &)
noexcept {
4706 &valid_len, &len_error)) {
4709 hexbuf, string_val.
str + valid_len,
4710 static_cast<uint>(std::min<size_t>(string_val.
length - valid_len, 3)));
4731 std::string &invalid_sub_str) {
4736 &valid_len, &len_error)) {
4737 char printable_buff[32];
4739 printable_buff,
sizeof(printable_buff), string_val.
str + valid_len,
4740 static_cast<uint>(std::min<size_t>(string_val.
length - valid_len, 3)),
4742 invalid_sub_str = printable_buff;
4755 Item *item [[maybe_unused]],
4756 bool hidden [[maybe_unused]]) {
4758 if (
std::find(fields.begin(), fields.end(), item) != fields.end()) {
4761 assert(item->hidden == hidden);
4773 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:203
Parser state for CTE subquery parser.
Definition: sql_lex.h:4628
Common_table_expr_parser_state()
Definition: sql_lex.cc:1153
PT_subquery * result
Definition: sql_lex.h:4632
Utility RAII class to save/modify/restore the condition_context information of a query block.
Definition: sql_lex.h:2402
enum_condition_context saved_value
Definition: sql_lex.h:2424
~Condition_context()
Definition: sql_lex.h:2418
Query_block * select
Definition: sql_lex.h:2423
Condition_context(Query_block *select_ptr, enum_condition_context new_type=enum_condition_context::NEITHER)
Definition: sql_lex.h:2404
Parser state for Derived table's condition parser.
Definition: sql_lex.h:4639
Item * result
Definition: sql_lex.h:4643
Derived_expr_parser_state()
Definition: sql_lex.cc:1156
Definition: event_parse_data.h:43
Parser state for single expression parser (.frm/DD stuff)
Definition: sql_lex.h:4618
Expression_parser_state()
Definition: sql_lex.cc:1150
Item * result
Definition: sql_lex.h:4622
Parser state for generated column expression parser (.frm/DD stuff)
Definition: sql_lex.h:4608
Value_generator * result
Definition: sql_lex.h:4612
Gcol_expr_parser_state()
Definition: sql_lex.cc:1147
Definition: sql_lex.h:485
LEX_CSTRING key_name
Definition: sql_lex.h:495
void print(const THD *thd, String *str)
Print an index hint.
Definition: sql_lex.cc:2651
index_clause_map clause
Definition: sql_lex.h:490
enum index_hint_type type
Definition: sql_lex.h:488
Index_hint(const char *str, uint length)
Definition: sql_lex.h:497
Definition: item_cmpfunc.h:2416
Definition: item_subselect.h:416
Definition: item_func.h:3336
Definition: item_func.h:3387
This class is used to implement operations like SET @variable or @variable:= expression.
Definition: item_func.h:3146
A wrapper Item that normally returns its parameter, but becomes NULL when processing rows for rollup.
Definition: item_func.h:1605
A wrapper Item that contains a number of aggregate items, one for each level of rollup (see Item_roll...
Definition: item_sum.h:2710
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:850
cond_result
Definition: item.h:919
@ COND_UNDEF
Definition: item.h:919
Definition: sql_optimizer.h:132
Definition: key_spec.h:66
Definition: sql_lex.h:3625