28#ifndef SQL_LEX_INCLUDED
29#define SQL_LEX_INCLUDED
61#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);
1337 ulong table_options,
1371 ulong want_privilege_next);
1637 const char *prefix);
1714 void cleanup(
bool full)
override;
1742 assert(
join ==
nullptr);
1822 bool optimize(
THD *thd,
bool finalize_access_paths);
2183 bool top,
bool in_sj,
Item **new_conds,
2184 uint *changelog =
nullptr);
2196 Item *join_cond,
bool left_outer,
2197 bool use_inner_join);
2201 bool reject_multiple_rows,
2202 Item *join_condition,
2203 Item *lifted_where_cond);
2211 bool added_card_check);
2261 Item **lifted_where);
2380 qt = down_cast<Query_term_unary *>(qt)->m_children[0];
2387 qt = down_cast<Query_term_unary *>(qt)->m_children[0];
2520 std::unique_ptr<malloc_unordered_map<std::string, Sroutine_hash_entry *>>
2573 *
this = std::move(*state);
2911 switch (accessed_table) {
2913 return "STMT_READS_TRANS_TABLE";
2916 return "STMT_READS_NON_TRANS_TABLE";
2919 return "STMT_READS_TEMP_TRANS_TABLE";
2922 return "STMT_READS_TEMP_NON_TRANS_TABLE";
2925 return "STMT_WRITES_TRANS_TABLE";
2928 return "STMT_WRITES_NON_TRANS_TABLE";
2931 return "STMT_WRITES_TEMP_TRANS_TABLE";
2934 return "STMT_WRITES_TEMP_NON_TRANS_TABLE";
2946#define BINLOG_DIRECT_ON \
2951#define BINLOG_DIRECT_OFF \
2956#define TRX_CACHE_EMPTY 0x33
2958#define TRX_CACHE_NOT_EMPTY 0xCC
2960#define IL_LT_REPEATABLE 0xAA
2962#define IL_GTE_REPEATABLE 0x55
3015 bool trx_cache_is_not_empty,
3016 uint tx_isolation) {
3017 bool unsafe =
false;
3019 if (in_multi_stmt_transaction_mode) {
3030 (
"RESULT %02X %02X %02X\n", condition,
3235 unsigned char yyGet() {
3251 unsigned char yyPeek()
const {
3260 unsigned char yyPeekn(
int n)
const {
3404 const char *end_ptr);
3469 const char *alias)
const {
4167 if (
unit ==
nullptr)
return;
4258 tr->restore_properties();
4299 bool copy_db_to(
char const **p_db,
size_t *p_db_length)
const;
4302 return copy_db_to(
const_cast<const char **
>(p_db), p_db_length);
4568 void reset(
const char *found_semicolon,
size_t length) {
4643 static void *
operator new(
size_t size)
noexcept {
4644 return (*THR_MALLOC)->Alloc(size);
4647 const std::nothrow_t &arg
4648 [[maybe_unused]] = std::nothrow)
noexcept {
4651 static void operator delete(
void *ptr [[maybe_unused]],
4652 size_t size [[maybe_unused]]) {
4655 static void operator delete(
4656 void *,
MEM_ROOT *,
const std::nothrow_t &)
noexcept {
4698 &valid_len, &len_error)) {
4701 hexbuf, string_val.
str + valid_len,
4702 static_cast<uint>(std::min<size_t>(string_val.
length - valid_len, 3)));
4723 std::string &invalid_sub_str) {
4728 &valid_len, &len_error)) {
4729 char printable_buff[32];
4731 printable_buff,
sizeof(printable_buff), string_val.
str + valid_len,
4732 static_cast<uint>(std::min<size_t>(string_val.
length - valid_len, 3)),
4734 invalid_sub_str = printable_buff;
4747 Item *item [[maybe_unused]],
4748 bool hidden [[maybe_unused]]) {
4750 if (
std::find(fields.begin(), fields.end(), item) != fields.end()) {
4753 assert(item->hidden == hidden);
4765 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:4620
Common_table_expr_parser_state()
Definition: sql_lex.cc:1151
PT_subquery * result
Definition: sql_lex.h:4624
Utility RAII class to save/modify/restore the condition_context information of a query block.
Definition: sql_lex.h:2394
enum_condition_context saved_value
Definition: sql_lex.h:2416
~Condition_context()
Definition: sql_lex.h:2410
Query_block * select
Definition: sql_lex.h:2415
Condition_context(Query_block *select_ptr, enum_condition_context new_type=enum_condition_context::NEITHER)
Definition: sql_lex.h:2396
Parser state for Derived table's condition parser.
Definition: sql_lex.h:4631
Item * result
Definition: sql_lex.h:4635
Derived_expr_parser_state()
Definition: sql_lex.cc:1154
Definition: event_parse_data.h:43
Parser state for single expression parser (.frm/DD stuff)
Definition: sql_lex.h:4610
Expression_parser_state()
Definition: sql_lex.cc:1148
Item * result
Definition: sql_lex.h:4614
Parser state for generated column expression parser (.frm/DD stuff)
Definition: sql_lex.h:4600
Value_generator * result
Definition: sql_lex.h:4604
Gcol_expr_parser_state()
Definition: sql_lex.cc:1145
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:2649
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:2422
Definition: item_subselect.h:414
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:1607
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:125
Definition: key_spec.h:66
Definition: sql_lex.h:3617
LEX_COLUMN(const String &x, const uint &y)
Definition: sql_lex.h:3621
uint rights
Definition: sql_lex.h:3620
String column
Definition: sql_lex.h:3619
Definition: sql_lex.h:3629
List< LEX_USER > * role_list
Definition: sql_lex.h:3638
void cleanup()
Definition: sql_lex.cc:5092
bool grant_as_used
Definition: sql_lex.h:3635