28#ifndef SQL_LEX_INCLUDED
29#define SQL_LEX_INCLUDED
60#include "mysqld_error.h"
256#define TYPE_ENUM_FUNCTION 1
257#define TYPE_ENUM_PROCEDURE 2
258#define TYPE_ENUM_TRIGGER 3
259#define TYPE_ENUM_PROXY 4
287#define TL_OPTION_UPDATING 0x01
288#define TL_OPTION_IGNORE_LEAVES 0x02
289#define TL_OPTION_ALIAS 0x04
478#define INDEX_HINT_MASK_JOIN (1)
479#define INDEX_HINT_MASK_GROUP (1 << 1)
480#define INDEX_HINT_MASK_ORDER (1 << 2)
482#define INDEX_HINT_MASK_ALL \
483 (INDEX_HINT_MASK_JOIN | INDEX_HINT_MASK_GROUP | INDEX_HINT_MASK_ORDER)
663 for (
auto qt : query_terms<>()) {
664 if (qt->query_block() == qb)
return qt;
704 auto const setop = down_cast<Query_term_set_op *>(
m_query_term);
705 if (setop->m_last_distinct > 0)
706 return setop->m_children[setop->m_last_distinct]->query_block();
713 return down_cast<Query_term_set_op *>(
m_query_term)->m_last_distinct > 0;
957 bool optimize(
THD *thd,
TABLE *materialize_destination,
bool create_iterators,
958 bool finalize_access_paths);
1349 ulong table_options,
1383 ulong want_privilege_next);
1653 const char *prefix);
1730 void cleanup(
bool full)
override;
1758 assert(
join ==
nullptr);
1838 bool optimize(
THD *thd,
bool finalize_access_paths);
2201 bool top,
bool in_sj,
Item **new_conds,
2202 uint *changelog =
nullptr);
2214 Item *join_cond,
bool left_outer,
2215 bool use_inner_join);
2219 bool reject_multiple_rows,
2220 Item *join_condition,
2221 Item *lifted_where_cond);
2229 bool added_card_check);
2279 Item **lifted_where);
2400 qt = down_cast<Query_term_unary *>(qt)->m_children[0];
2407 qt = down_cast<Query_term_unary *>(qt)->m_children[0];
2541 std::unique_ptr<malloc_unordered_map<std::string, Sroutine_hash_entry *>>
2594 *
this = std::move(*state);
2932 switch (accessed_table) {
2934 return "STMT_READS_TRANS_TABLE";
2937 return "STMT_READS_NON_TRANS_TABLE";
2940 return "STMT_READS_TEMP_TRANS_TABLE";
2943 return "STMT_READS_TEMP_NON_TRANS_TABLE";
2946 return "STMT_WRITES_TRANS_TABLE";
2949 return "STMT_WRITES_NON_TRANS_TABLE";
2952 return "STMT_WRITES_TEMP_TRANS_TABLE";
2955 return "STMT_WRITES_TEMP_NON_TRANS_TABLE";
2967#define BINLOG_DIRECT_ON \
2972#define BINLOG_DIRECT_OFF \
2977#define TRX_CACHE_EMPTY 0x33
2979#define TRX_CACHE_NOT_EMPTY 0xCC
2981#define IL_LT_REPEATABLE 0xAA
2983#define IL_GTE_REPEATABLE 0x55
3036 bool trx_cache_is_not_empty,
3037 uint tx_isolation) {
3038 bool unsafe =
false;
3040 if (in_multi_stmt_transaction_mode) {
3041 const uint condition =
3051 (
"RESULT %02X %02X %02X\n", condition,
3256 unsigned char yyGet() {
3258 const char c = *
m_ptr++;
3272 unsigned char yyPeek()
const {
3281 unsigned char yyPeekn(
int n)
const {
3425 const char *end_ptr);
3490 const char *alias)
const {
4188 if (
unit ==
nullptr)
return;
4279 tr->restore_properties();
4320 bool copy_db_to(
char const **p_db,
size_t *p_db_length)
const;
4323 return copy_db_to(
const_cast<const char **
>(p_db), p_db_length);
4589 void reset(
const char *found_semicolon,
size_t length) {
4664 static void *
operator new(
size_t size)
noexcept {
4665 return (*THR_MALLOC)->Alloc(size);
4668 const std::nothrow_t &arg
4669 [[maybe_unused]] = std::nothrow)
noexcept {
4672 static void operator delete(
void *ptr [[maybe_unused]],
4673 size_t size [[maybe_unused]]) {
4676 static void operator delete(
4677 void *,
MEM_ROOT *,
const std::nothrow_t &)
noexcept {
4718 &valid_len, &len_error)) {
4721 hexbuf, string_val.
str + valid_len,
4722 static_cast<uint
>(std::min<size_t>(string_val.
length - valid_len, 3)));
4743 std::string &invalid_sub_str) {
4748 &valid_len, &len_error)) {
4749 char printable_buff[32];
4751 printable_buff,
sizeof(printable_buff), string_val.
str + valid_len,
4752 static_cast<uint
>(std::min<size_t>(string_val.
length - valid_len, 3)),
4754 invalid_sub_str = printable_buff;
4767 Item *item [[maybe_unused]],
4768 bool hidden [[maybe_unused]]) {
4770 if (
std::find(fields.begin(), fields.end(), item) != fields.end()) {
4773 assert(item->hidden == hidden);
4785 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:4641
Common_table_expr_parser_state()
Definition: sql_lex.cc:1207
PT_subquery * result
Definition: sql_lex.h:4645
Utility RAII class to save/modify/restore the condition_context information of a query block.
Definition: sql_lex.h:2414
enum_condition_context saved_value
Definition: sql_lex.h:2436
~Condition_context()
Definition: sql_lex.h:2430
Query_block * select
Definition: sql_lex.h:2435
Condition_context(Query_block *select_ptr, enum_condition_context new_type=enum_condition_context::NEITHER)
Definition: sql_lex.h:2416
Parser state for Derived table's condition parser.
Definition: sql_lex.h:4652
Item * result
Definition: sql_lex.h:4656
Derived_expr_parser_state()
Definition: sql_lex.cc:1210
Definition: event_parse_data.h:43
Parser state for single expression parser (.frm/DD stuff)
Definition: sql_lex.h:4631
Expression_parser_state()
Definition: sql_lex.cc:1204
Item * result
Definition: sql_lex.h:4635
Parser state for generated column expression parser (.frm/DD stuff)
Definition: sql_lex.h:4621
Value_generator * result
Definition: sql_lex.h:4625
Gcol_expr_parser_state()
Definition: sql_lex.cc:1201
Definition: sql_lex.h:486
LEX_CSTRING key_name
Definition: sql_lex.h:496
void print(const THD *thd, String *str)
Print an index hint.
Definition: sql_lex.cc:2751
index_clause_map clause
Definition: sql_lex.h:491
enum index_hint_type type
Definition: sql_lex.h:489
Index_hint(const char *str, uint length)
Definition: sql_lex.h:498
Definition: item_cmpfunc.h:2434
Definition: item_subselect.h:418
Definition: item_func.h:3366
Definition: item_func.h:3417
This class is used to implement operations like SET @variable or @variable:= expression.
Definition: item_func.h:3176
A wrapper Item that normally returns its parameter, but becomes NULL when processing rows for rollup.
Definition: item_func.h:1635
A wrapper Item that contains a number of aggregate items, one for each level of rollup (see Item_roll...
Definition: item_sum.h:2714
Base class that is common to all subqueries and subquery predicates.
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:853
cond_result
Definition: item.h:922
@ COND_UNDEF
Definition: item.h:922
Definition: sql_optimizer.h:132
Definition: key_spec.h:66