29#ifndef SQL_LEX_INCLUDED
30#define SQL_LEX_INCLUDED
62#include "mysqld_error.h"
260#define TYPE_ENUM_FUNCTION 1
261#define TYPE_ENUM_PROCEDURE 2
262#define TYPE_ENUM_TRIGGER 3
263#define TYPE_ENUM_PROXY 4
264#define TYPE_ENUM_LIBRARY 5
265#define TYPE_ENUM_INVALID 6
301#define TL_OPTION_UPDATING 0x01
302#define TL_OPTION_IGNORE_LEAVES 0x02
303#define TL_OPTION_ALIAS 0x04
493#define INDEX_HINT_MASK_JOIN (1)
494#define INDEX_HINT_MASK_GROUP (1 << 1)
495#define INDEX_HINT_MASK_ORDER (1 << 2)
497#define INDEX_HINT_MASK_ALL \
498 (INDEX_HINT_MASK_JOIN | INDEX_HINT_MASK_GROUP | INDEX_HINT_MASK_ORDER)
678 for (
auto qt : query_terms<>()) {
679 if (qt->query_block() == qb)
return qt;
719 auto const setop = down_cast<Query_term_set_op *>(
m_query_term);
720 if (setop->last_distinct() > 0)
721 return setop->child(setop->last_distinct())->query_block();
728 return down_cast<Query_term_set_op *>(
m_query_term)->last_distinct() > 0;
967 bool finalize_access_paths);
1198 bool calc_found_rows)
override;
1385 ulong table_options,
1693 const char *prefix);
1780 void cleanup(
bool full)
override;
1808 assert(
join ==
nullptr);
1888 bool optimize(
THD *thd,
bool finalize_access_paths);
2279 bool top,
bool in_sj,
Item **new_conds,
2280 uint *changelog =
nullptr);
2286 Item **sj_cond,
bool *simple_const);
2292 Item *join_cond,
bool left_outer,
2293 bool use_inner_join);
2297 bool reject_multiple_rows,
2299 Item *lifted_where_cond);
2307 Item *selected_field_or_ref,
2308 const uint first_non_hidden);
2313 bool *selected_expr_added_to_group_by,
2318 bool *added_card_check,
size_t *added_window_card_checks);
2321 bool added_card_check,
size_t added_window_card_checks);
2373 Item **lifted_where);
2523 qt = down_cast<Query_term_unary *>(qt)->child(0);
2530 qt = down_cast<Query_term_unary *>(qt)->child(0);
2626 assert(!libs.
empty());
2632 while (!libs.
empty()) {
2756 std::unique_ptr<malloc_unordered_map<std::string, Sroutine_hash_entry *>>
2814 *
this = std::move(*state);
3089 constexpr uint32_t shift =
3101 constexpr uint32_t shift =
3155 switch (accessed_table) {
3157 return "STMT_READS_TRANS_TABLE";
3160 return "STMT_READS_NON_TRANS_TABLE";
3163 return "STMT_READS_TEMP_TRANS_TABLE";
3166 return "STMT_READS_TEMP_NON_TRANS_TABLE";
3169 return "STMT_WRITES_TRANS_TABLE";
3172 return "STMT_WRITES_NON_TRANS_TABLE";
3175 return "STMT_WRITES_TEMP_TRANS_TABLE";
3178 return "STMT_WRITES_TEMP_NON_TRANS_TABLE";
3190#define BINLOG_DIRECT_ON \
3195#define BINLOG_DIRECT_OFF \
3200#define TRX_CACHE_EMPTY 0x33
3202#define TRX_CACHE_NOT_EMPTY 0xCC
3204#define IL_LT_REPEATABLE 0xAA
3206#define IL_GTE_REPEATABLE 0x55
3259 bool trx_cache_is_not_empty,
3260 uint tx_isolation) {
3261 bool unsafe =
false;
3263 if (in_multi_stmt_transaction_mode) {
3264 const uint condition =
3274 (
"RESULT %02X %02X %02X\n", condition,
3479 unsigned char yyGet() {
3481 const char c = *
m_ptr++;
3495 unsigned char yyPeek()
const {
3504 unsigned char yyPeekn(
int n)
const {
3648 const char *end_ptr);
3713 const char *alias)
const {
4159 const bool execute_only_in_secondary_engine_param,
4162 execute_only_in_secondary_engine_param;
4179 return "TABLESAMPLE";
4181 return "OUTFILE to object store";
4190 bool execute_in_hypergraph_optimizer_param,
4193 execute_in_hypergraph_optimizer_param;
4592 if (
unit ==
nullptr)
return;
4684 tr->restore_properties();
4725 bool copy_db_to(
char const **p_db,
size_t *p_db_length)
const;
4728 return copy_db_to(
const_cast<const char **
>(p_db), p_db_length);