MySQL 8.4.5
Source Code Documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
parse_tree_nodes.h
Go to the documentation of this file.
1/* Copyright (c) 2013, 2025, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef PARSE_TREE_NODES_INCLUDED
25#define PARSE_TREE_NODES_INCLUDED
26
27#include <assert.h>
28#include <sys/types.h> // TODO: replace with cstdint
29
30#include <bit>
31#include <cctype> // std::isspace
32#include <cstddef>
33#include <memory>
34
35#include "lex_string.h"
36#include "my_alloc.h"
37#include "my_base.h"
38
39#include "my_inttypes.h" // TODO: replace with cstdint
40#include "my_list.h"
41#include "my_sqlcommand.h"
42#include "my_sys.h"
43#include "my_thread_local.h"
44#include "my_time.h"
45#include "mysqld_error.h"
46#include "sql/check_stack.h"
47#include "sql/enum_query_type.h"
48#include "sql/handler.h"
49#include "sql/key_spec.h"
50#include "sql/mem_root_array.h"
51#include "sql/opt_explain.h" // Sql_cmd_explain_other_thread
52#include "sql/parse_location.h"
53#include "sql/parse_tree_helpers.h" // PT_item_list
55#include "sql/parser_yystype.h"
56#include "sql/partition_info.h"
59#include "sql/set_var.h"
60#include "sql/sql_admin.h" // Sql_cmd_shutdown etc.
61#include "sql/sql_alter.h"
62#include "sql/sql_check_constraint.h" // Sql_check_constraint_spec
63#include "sql/sql_cmd_srs.h"
64#include "sql/sql_exchange.h"
65#include "sql/sql_lex.h" // LEX
66#include "sql/sql_list.h"
67#include "sql/sql_load.h" // Sql_cmd_load_table
69#include "sql/sql_restart_server.h" // Sql_cmd_restart_server
70#include "sql/sql_tablespace.h" // Tablespace_options
71#include "sql/sql_truncate.h" // Sql_cmd_truncate_table
72#include "sql/table.h" // Common_table_expr
73#include "sql/tablesample.h"
74#include "sql/window_lex.h"
75#include "string_with_len.h"
76#include "thr_lock.h"
77
78class Item;
79class Item_cache;
83class PT_hint_list;
86class PT_partition;
87class PT_subquery;
88class PT_type;
89class PT_window_list;
90class Sql_cmd;
91class String;
92class THD;
93class Window;
94class sp_head;
95class sp_name;
96struct CHARSET_INFO;
97
98/**
99 @defgroup ptn Parse tree nodes
100 @ingroup Parser
101*/
102/**
103 @defgroup ptn_stmt Nodes representing SQL statements
104 @ingroup ptn
105*/
106/**
107 @defgroup ptn_create_table CREATE TABLE statement
108 @ingroup ptn_stmt
109*/
110/**
111 @defgroup ptn_alter_table ALTER TABLE statement
112 @ingroup ptn_stmt
113*/
114/**
115 @defgroup ptn_create_table_stuff Clauses of CREATE TABLE statement
116 @ingroup ptn_create_table
117*/
118/**
119 @defgroup ptn_partitioning CREATE/ALTER TABLE partitioning-related stuff
120 @ingroup ptn_create_table ptn_alter_table
121*/
122/**
123 @defgroup ptn_part_options Partition options in CREATE/ALTER TABLE
124 @ingroup ptn_partitioning
125*/
126/**
127 @defgroup ptn_create_or_alter_table_options Table options of CREATE/ALTER
128 TABLE
129 @anchor ptn_create_or_alter_table_options
130 @ingroup ptn_create_table ptn_alter_table
131*/
132/**
133 @defgroup ptn_col_types Column types in CREATE/ALTER TABLE
134 @ingroup ptn_create_table ptn_alter_table
135*/
136/**
137 @defgroup ptn_col_attrs Column attributes in CREATE/ALTER TABLE
138 @ingroup ptn_create_table ptn_alter_table
139*/
140/**
141 @defgroup ptn_not_gcol_attr Non-generated column attributes in CREATE/ALTER
142 TABLE
143 @ingroup ptn_col_attrs ptn_alter_table
144*/
145
146/**
147 Calls contextualize() on every node in the array.
148*/
149template <class Node_type, class Parse_context_type>
151 Parse_context_type *pc) {
152 for (Node_type *i : nodes)
153 if (i->contextualize(pc)) return true;
154 return false;
155}
156
157/**
158 Base class for all top-level nodes of SQL statements
159
160 @ingroup ptn_stmt
161*/
164 void operator=(const Parse_tree_root &) = delete;
165
166 protected:
167 Parse_tree_root() = default;
168 explicit Parse_tree_root(const POS &pos) : m_pos(pos) {}
169 virtual ~Parse_tree_root() = default;
170
171 public:
172 /// Textual location of a token just parsed.
174
175 virtual Sql_cmd *make_cmd(THD *thd) = 0;
176
177 // Return Json parse tree generated by SHOW PARSE_TREE.
178 virtual std::string get_printable_parse_tree(THD *thd [[maybe_unused]]) {
179 my_error(ER_NOT_SUPPORTED_YET, MYF(0),
180 "Parse tree display of this statement");
181 return "";
182 }
183};
184
186 public:
189
190 ~PT_table_ddl_stmt_base() override = 0; // force abstract class
191
192 protected:
194};
195
197
198/**
199 Parse context for the table DDL (ALTER TABLE and CREATE TABLE) nodes.
200
201 For internal use in the contextualization code.
202*/
204 Table_ddl_parse_context(THD *thd_arg, Query_block *select_arg,
209};
210
211/**
212 Base class for all table DDL (ALTER TABLE and CREATE TABLE) nodes.
213*/
215
216class PT_order_expr : public Parse_tree_node, public ORDER {
218
219 public:
220 PT_order_expr(const POS &pos, Item *item_arg, enum_order dir) : super(pos) {
221 item_initial = item_arg;
223 }
224
225 bool do_contextualize(Parse_context *pc) override;
226
227 protected:
228 void add_json_info(Json_object *obj) override {
229 obj->add_alias("desc",
230 create_dom_ptr<Json_boolean>(direction == ORDER_DESC));
231 }
232};
233
236
237 public:
239
240 public:
241 explicit PT_order_list(const POS &pos) : super(pos) {}
242
243 bool do_contextualize(Parse_context *pc) override {
244 if (super::do_contextualize(pc)) return true;
245 for (ORDER *o = value.first; o != nullptr; o = o->next) {
246 if (static_cast<PT_order_expr *>(o)->contextualize(pc)) return true;
247 }
248 return false;
249 }
250
252 order->used_alias = nullptr;
253 order->used = 0;
254 value.link_in_list(order, &order->next);
255 }
256};
257
260
261 public:
262 explicit PT_gorder_list(const POS &pos) : super(pos) {}
263
264 bool do_contextualize(Parse_context *pc) override {
265 return super::do_contextualize(pc);
266 }
267};
268
269/**
270 Represents an element of the WITH list:
271 WITH [...], [...] SELECT ...,
272 ^ or ^
273 i.e. a Common Table Expression (CTE, or Query Name in SQL99 terms).
274*/
277
278 public:
279 explicit PT_common_table_expr(const POS &pos, const LEX_STRING &name,
280 const LEX_STRING &subq_text,
281 uint subq_text_offset, PT_subquery *sn,
284
285 /// The name after AS
286 const LEX_STRING &name() const { return m_name; }
287 /**
288 @param thd Thread handler
289 @param[out] node PT_subquery
290 @returns a PT_subquery to attach to a table reference for this CTE
291 */
292 bool make_subquery_node(THD *thd, PT_subquery **node);
293 /**
294 @param tl Table reference to match
295 @param in_self If this is a recursive reference
296 @param[out] found Is set to true/false if matches or not
297 @returns true if error
298 */
299 bool match_table_ref(Table_ref *tl, bool in_self, bool *found);
300 /**
301 @returns true if 'other' is the same instance as 'this'
302 */
303 bool is(const Common_table_expr *other) const {
304 return other == &m_postparse;
305 }
306 void print(const THD *thd, String *str, enum_query_type query_type);
307 bool do_contextualize(Parse_context *pc) override;
308
309 protected:
310 void add_json_info(Json_object *obj) override;
311
312 private:
314 /// Raw text of query expression (including parentheses)
316 /**
317 Offset in bytes of m_subq_text in original statement which had the WITH
318 clause.
319 */
321 /// Parsed version of subq_text
323 /// List of explicitly specified column names; if empty, no list.
325 /**
326 A Table_ref representing a CTE needs access to the WITH list
327 element it derives from. However, in order to:
328 - limit the members which Table_ref can access
329 - avoid including this header file everywhere Table_ref needs to
330 access these members, these members are relocated into a separate inferior
331 object whose declaration is in table.h, like that of Table_ref. It's
332 the "postparse" part. Table_ref accesses this inferior object only.
333 */
335
337};
338
339/**
340 Represents the WITH list.
341 WITH [...], [...] SELECT ...,
342 ^^^^^^^^^^^^
343*/
346
347 public:
348 /// @param pos Position of this clause in the SQL statement.
349 /// @param mem_root where interior objects are allocated
350 explicit PT_with_list(const POS &pos, MEM_ROOT *mem_root)
351 : super(pos), m_elements(mem_root) {}
354 return m_elements;
355 }
356
357 private:
359};
360
361/**
362 Represents the WITH clause:
363 WITH [...], [...] SELECT ...,
364 ^^^^^^^^^^^^^^^^^
365*/
368
369 public:
370 PT_with_clause(const POS &pos, const PT_with_list *l, bool r)
371 : super(pos),
372 m_list(l),
373 m_recursive(r),
375
376 bool do_contextualize(Parse_context *pc) override;
377
378 /**
379 Looks up a table reference into the list of CTEs.
380 @param tl Table reference to look up
381 @param[out] found Is set to true/false if found or not
382 @returns true if error
383 */
384 bool lookup(Table_ref *tl, PT_common_table_expr **found);
385 /**
386 Call this to record in the WITH clause that we are contextualizing the
387 CTE definition inserted in table reference 'tl'.
388 @returns information which the caller must provide to
389 leave_parsing_definition().
390 */
392 auto old = m_most_inner_in_parsing;
394 return old;
395 }
398 }
399 void print(const THD *thd, String *str, enum_query_type query_type);
400
401 protected:
402 void add_json_info(Json_object *obj) override {
403 obj->add_alias("recursive", create_dom_ptr<Json_boolean>(m_recursive));
404 }
405
406 private:
407 /// All CTEs of this clause
408 const PT_with_list *const m_list;
409 /// True if the user has specified the RECURSIVE keyword.
410 const bool m_recursive;
411 /**
412 The innermost CTE reference which we're parsing at the
413 moment. Used to detect forward references, loops and recursiveness.
414 */
416
418};
419
422
423 public:
424 explicit PT_select_item_list(const POS &pos) : super(pos) {}
425
426 bool do_contextualize(Parse_context *pc) override;
427};
428
431
433
434 protected:
435 void add_json_info(Json_object *obj) override {
436 obj->add_alias("is_offset_first",
437 create_dom_ptr<Json_boolean>(limit_options.is_offset_first));
438 }
439
440 public:
441 PT_limit_clause(const POS &pos, const Limit_options &limit_options_arg)
442 : super(pos), limit_options(limit_options_arg) {}
443
444 bool do_contextualize(Parse_context *pc) override;
446};
447
448class PT_cross_join;
449class PT_joined_table;
450
452 public:
453 explicit PT_table_reference(const POS &pos) : Parse_tree_node(pos) {}
454
456
457 /**
458 Lets us build a parse tree top-down, which is necessary due to the
459 context-dependent nature of the join syntax. This function adds
460 the @<table_ref@> cross join as the left-most leaf in this join tree
461 rooted at this node.
462
463 @todo: comment on non-join PT_table_reference objects
464
465 @param cj This @<table ref@> will be added if it represents a cross join.
466
467 @return The new top-level join.
468 */
470};
471
474
477 const char *const opt_table_alias;
480
481 public:
482 PT_table_factor_table_ident(const POS &pos, Table_ident *table_ident_arg,
483 List<String> *opt_use_partition_arg,
484 const LEX_CSTRING &opt_table_alias_arg,
485 List<Index_hint> *opt_key_definition_arg,
486 PT_tablesample *opt_tablesample_arg)
487 : super(pos),
488 table_ident(table_ident_arg),
489 opt_use_partition(opt_use_partition_arg),
490 opt_table_alias(opt_table_alias_arg.str),
491 opt_key_definition(opt_key_definition_arg),
492 opt_tablesample(opt_tablesample_arg) {}
493
494 protected:
495 bool do_contextualize(Parse_context *pc) override;
496 void add_json_info(Json_object *obj) override;
497};
498
500 protected:
501 explicit PT_json_table_column(const POS &pos) : Parse_tree_node(pos) {}
502
503 public:
505};
506
509
510 public:
513 const LEX_STRING &table_alias)
514 : super(pos),
515 m_expr(expr),
516 m_path(path),
517 m_nested_columns(nested_cols),
518 m_table_alias(table_alias) {}
519
520 bool do_contextualize(Parse_context *pc) override;
521
522 private:
527};
528
531
533
534 public:
537 : super(pos), table_list(table_list) {}
538
539 bool do_contextualize(Parse_context *pc) override;
540};
541
544
545 public:
546 PT_derived_table(const POS &pos, bool lateral, PT_subquery *subquery,
547 const LEX_CSTRING &table_alias,
549
550 bool do_contextualize(Parse_context *pc) override;
551
552 protected:
553 void add_json_info(Json_object *obj) override;
554
555 private:
558 const char *const m_table_alias;
559 /// List of explicitly specified column names; if empty, no list.
561};
562
565
566 public:
568 : super(pos), m_joined_table(joined_table) {}
569
570 bool do_contextualize(Parse_context *pc) override;
571
572 private:
574};
575
578
579 protected:
584
587
588 public:
589 PT_joined_table(const POS &pos, PT_table_reference *tab1_node_arg,
590 const POS &join_pos_arg, PT_joined_table_type type,
591 PT_table_reference *tab2_node_arg)
592 : super(pos),
593 m_left_pt_table(tab1_node_arg),
594 m_join_pos(join_pos_arg),
595 m_type(type),
596 m_right_pt_table(tab2_node_arg) {
597 using std::has_single_bit;
598 static_assert(has_single_bit(unsigned{JTT_INNER}), "not a single bit");
599 static_assert(has_single_bit(unsigned{JTT_STRAIGHT}), "not a single bit");
600 static_assert(has_single_bit(unsigned{JTT_NATURAL}), "not a single bit");
601 static_assert(has_single_bit(unsigned{JTT_LEFT}), "not a single bit");
602 static_assert(has_single_bit(unsigned{JTT_RIGHT}), "not a single bit");
603
604 assert(type == JTT_INNER || type == JTT_STRAIGHT_INNER ||
607 }
608
609 /**
610 Adds the cross join to this join operation. The cross join is nested as
611 the table reference on the left-hand side.
612 */
615 return this;
616 }
617
618 /// Adds the table reference as the right-hand side of this join.
620 assert(m_right_pt_table == nullptr);
622 }
623
624 bool do_contextualize(Parse_context *pc) override;
625
626 /// This class is being inherited, it should thus be abstract.
627 ~PT_joined_table() override = 0;
628
629 protected:
631 void add_json_info(Json_object *obj) override;
632};
633
634inline PT_joined_table::~PT_joined_table() = default;
635
638
639 public:
640 PT_cross_join(const POS &pos, PT_table_reference *tab1_node_arg,
641 const POS &join_pos_arg, PT_joined_table_type Type_arg,
642 PT_table_reference *tab2_node_arg)
643 : PT_joined_table(pos, tab1_node_arg, join_pos_arg, Type_arg,
644 tab2_node_arg) {}
645
646 bool do_contextualize(Parse_context *pc) override;
647};
648
652
653 public:
654 PT_joined_table_on(const POS &pos, PT_table_reference *tab1_node_arg,
655 const POS &join_pos_arg, PT_joined_table_type type,
656 PT_table_reference *tab2_node_arg, Item *on_arg)
657 : super(pos, tab1_node_arg, join_pos_arg, type, tab2_node_arg),
658 on(on_arg) {}
659
660 bool do_contextualize(Parse_context *pc) override;
661};
662
666
667 public:
668 PT_joined_table_using(const POS &pos, PT_table_reference *tab1_node_arg,
669 const POS &join_pos_arg, PT_joined_table_type type,
670 PT_table_reference *tab2_node_arg,
671 List<String> *using_fields_arg)
672 : super(pos, tab1_node_arg, join_pos_arg, type, tab2_node_arg),
673 using_fields(using_fields_arg) {}
674
675 /// A PT_joined_table_using without a list of columns denotes a natural join.
676 PT_joined_table_using(const POS &pos, PT_table_reference *tab1_node_arg,
677 const POS &join_pos_arg, PT_joined_table_type type,
678 PT_table_reference *tab2_node_arg)
679 : PT_joined_table_using(pos, tab1_node_arg, join_pos_arg, type,
680 tab2_node_arg, nullptr) {}
681
682 bool do_contextualize(Parse_context *pc) override;
683
684 protected:
685 void add_json_info(Json_object *obj) override;
686};
687
688/*
689 PT_tablesample - parse tree node
690
691 Information contained in TABLESAMPLE clause is here.
692*/
695
696 public:
699
700 PT_tablesample(const POS &pos, tablesample_type tablesample_type_arg,
701 Item *sample_percentage)
702 : super(pos),
703 m_sampling_type(tablesample_type_arg),
704 m_sample_percentage(sample_percentage) {}
705};
706
707class PT_group : public Parse_tree_node {
709
712
713 protected:
714 void add_json_info(Json_object *obj) override {
715 if (olap == ROLLUP_TYPE)
716 obj->add_alias("olap_options", create_dom_ptr<Json_string>("ROLLUP"));
717 // Only rollup type supported.
718 }
719
720 public:
721 PT_group(const POS &pos, PT_order_list *group_list_arg, olap_type olap_arg)
722 : super(pos), group_list(group_list_arg), olap(olap_arg) {}
723
724 bool do_contextualize(Parse_context *pc) override;
725};
726
727class PT_order : public Parse_tree_node {
729
730 public:
732 explicit PT_order(const POS &pos, PT_order_list *order_list_arg)
733 : super(pos), order_list(order_list_arg) {}
734
735 bool do_contextualize(Parse_context *pc) override;
736};
737
739 public:
740 PT_locking_clause(const POS &pos, Lock_strength strength,
742 : Parse_tree_node(pos),
743 m_lock_strength(strength),
745
746 bool do_contextualize(Parse_context *pc) final;
747
748 virtual bool set_lock_for_tables(Parse_context *pc) = 0;
749
751
752 protected:
754 thr_lock_type lock_type = TL_IGNORE;
755 switch (m_lock_strength) {
757 lock_type = TL_WRITE;
758 break;
760 lock_type = TL_READ_WITH_SHARED_LOCKS;
761 break;
762 }
763
764 return {lock_type, static_cast<thr_locked_row_action>(action())};
765 }
766
767 private:
770};
771
773 public:
775 const POS &pos, Lock_strength strength,
777 : PT_locking_clause(pos, strength, action) {}
778
779 bool set_lock_for_tables(Parse_context *pc) override;
780};
781
783 public:
785
789 : PT_locking_clause(pos, strength, action), m_tables(tables) {}
790
791 bool set_lock_for_tables(Parse_context *pc) override;
792
793 private:
794 bool raise_error(THD *thd, const Table_ident *name, int error);
795
796 bool raise_error(int error);
797
799};
800
802 public:
804 : Parse_tree_node(pos) {
806 }
807
808 bool push_back(PT_locking_clause *locking_clause) {
809 return m_locking_clauses.push_back(locking_clause);
810 }
811
812 bool do_contextualize(Parse_context *pc) override {
813 for (auto locking_clause : m_locking_clauses)
814 if (locking_clause->contextualize(pc)) return true;
815 return false;
816 }
817
818 private:
820};
821
823 public:
824 explicit PT_query_expression_body(const POS &pos) : Parse_tree_node(pos) {}
826 virtual Setop_type type() const { return NONE; }
827 virtual bool is_set_operation() const = 0;
828 /**
829 True if this query expression can absorb an extraneous order by/limit
830 clause. The `ORDER BY`/`LIMIT` syntax is mostly consistestent, i.e. a
831 trailing clause may not refer to the tables in the `<query primary>`, with
832 one glaring exception:
833
834 (...( SELECT ... )...) ORDER BY ...
835
836 If the nested query expression doesn't contain `ORDER BY`, the statement
837 is interpreted as if the `ORDER BY` was absorbed by the innermost query
838 expression, i.e.:
839
840 (...( SELECT ... ORDER BY ... )...)
841
842 There is no rewriting of the parse tree nor AST happening here, the
843 transformation is done by the contextualizer (see
844 PT_query_expression::contextualize_order_and_limit), which interprets the
845 parse tree, and builds the AST according to this interpretation. This
846 interpretation is governed by the following rule: An `ORDER BY` can be
847 absorbed if none the nested query expressions contains an `ORDER BY` *or*
848 `LIMIT`. The rule is complex, so here are some examples for illustration:
849
850 In these cases the `ORDER BY` *is* absorbed:
851
852 ( SELECT * FROM t1 ) ORDER BY t1.a;
853 (( SELECT * FROM t1 )) ORDER BY t1.a;
854
855 In these cases the ORDER BY is *not* absorbed:
856
857 ( SELECT * FROM t1 ORDER BY 1 ) ORDER BY t1.a;
858 (( SELECT * FROM t1 ) ORDER BY 1 ) ORDER BY t1.a;
859 ( SELECT * FROM t1 LIMIT 1 ) ORDER BY t1.a;
860 (( SELECT * FROM t1 ) LIMIT 1 ) ORDER BY t1.a;
861
862 The same happens with `LIMIT`, obviously, but the optimizer is freeer to
863 choose when to apply the limit, and there are name no resolution issues
864 involved.
865
866 @param order True if the outer query block has the ORDER BY clause.
867 @param limit True if the outer query block has the LIMIT clause.
868 */
869 virtual bool can_absorb_order_and_limit(bool order, bool limit) const = 0;
870 virtual bool has_into_clause() const = 0;
871 virtual bool has_trailing_into_clause() const = 0;
872
873 virtual bool is_table_value_constructor() const = 0;
875};
876
879
880 public:
881 PT_set_scoped_system_variable(const POS &pos, const POS &var_pos,
882 const LEX_CSTRING &opt_prefix,
883 const LEX_CSTRING &name, Item *opt_expr)
884 : super(pos),
885 m_varpos(var_pos),
886 m_opt_prefix{opt_prefix},
887 m_name{name},
888 m_opt_expr{opt_expr} {}
889
890 bool do_contextualize(Parse_context *pc) override;
891
892 private:
897};
898
900 protected:
902 : Parse_tree_node(pos) {}
903};
904
907
908 public:
909 PT_set_variable(const POS &pos, const POS &varpos,
910 const LEX_CSTRING &opt_prefix, const LEX_CSTRING &name,
911 const POS &expr_pos, Item *opt_expr)
912 : super{pos},
913 m_varpos{varpos},
914 m_opt_prefix{opt_prefix},
915 m_name{name},
916 m_expr_pos{expr_pos},
917 m_opt_expr{opt_expr} {}
918
919 bool do_contextualize(Parse_context *pc) override;
920
921 private:
927};
928
932
935
936 public:
938 const LEX_STRING &name_arg,
939 Item *expr_arg)
940 : super(pos), name(name_arg), expr(expr_arg) {}
941
942 bool do_contextualize(Parse_context *pc) override;
943};
944
947
948 public:
950 const POS &name_pos, const LEX_CSTRING &opt_prefix,
951 const LEX_CSTRING &name, Item *opt_expr)
952 : super(pos),
953 m_scope{scope},
954 m_name_pos{name_pos},
955 m_opt_prefix{opt_prefix},
956 m_name{name},
957 m_opt_expr{opt_expr} {}
958
959 bool do_contextualize(Parse_context *pc) override;
960
961 private:
967};
968
972
974
975 public:
977 const CHARSET_INFO *opt_charset_arg)
978 : super(pos), opt_charset(opt_charset_arg) {}
979
980 bool do_contextualize(Parse_context *pc) override;
981};
982
986
988
989 public:
991 const POS &error_pos)
992 : super(pos), m_error_pos(error_pos) {}
993
994 bool do_contextualize(Parse_context *pc) override;
995};
996
999
1002
1003 public:
1004 PT_set_names(const POS &pos, const CHARSET_INFO *opt_charset_arg,
1005 const CHARSET_INFO *opt_collation_arg)
1006 : super(pos),
1007 opt_charset(opt_charset_arg),
1008 opt_collation(opt_collation_arg) {}
1009
1010 bool do_contextualize(Parse_context *pc) override;
1011};
1012
1014 protected:
1015 explicit PT_start_option_value_list(const POS &pos) : Parse_tree_node(pos) {}
1016};
1017
1021
1022 const char *password;
1023 const char *current_password;
1027
1028 public:
1030 const char *password_arg,
1031 const char *current_password_arg,
1032 bool retain_current,
1033 bool random_password,
1034 const POS &expr_pos_arg)
1035 : super(pos),
1036 password(password_arg),
1037 current_password(current_password_arg),
1038 retain_current_password(retain_current),
1039 random_password_generator(random_password),
1040 expr_pos(expr_pos_arg) {}
1041
1042 bool do_contextualize(Parse_context *pc) override;
1043};
1044
1048
1050 const char *password;
1051 const char *current_password;
1055
1056 public:
1058 const POS &pos, LEX_USER *user_arg, const char *password_arg,
1059 const char *current_password_arg, bool retain_current, bool random_pass,
1060 const POS &expr_pos_arg)
1061 : super(pos),
1062 user(user_arg),
1063 password(password_arg),
1064 current_password(current_password_arg),
1065 retain_current_password(retain_current),
1066 random_password_generator(random_pass),
1067 expr_pos(expr_pos_arg) {}
1068
1069 bool do_contextualize(Parse_context *pc) override;
1070};
1071
1074
1077
1078 public:
1081 : super(pos), type(type_arg), value(value_arg) {}
1082
1083 bool do_contextualize(Parse_context *pc) override;
1084};
1085
1088
1092
1093 public:
1094 PT_option_value_list_head(const POS &pos, const POS &delimiter_pos_arg,
1095 Parse_tree_node *value_arg,
1096 const POS &value_pos_arg)
1097 : super(pos),
1098 delimiter_pos(delimiter_pos_arg),
1099 value(value_arg),
1100 value_pos(value_pos_arg) {}
1101
1102 bool do_contextualize(Parse_context *pc) override;
1103};
1104
1107
1109
1110 public:
1112 const POS &delimiter_pos_arg, Parse_tree_node *tail,
1113 const POS &tail_pos)
1114 : super(pos, delimiter_pos_arg, tail, tail_pos), head(head_arg) {}
1115
1116 bool do_contextualize(Parse_context *pc) override {
1117 uchar dummy;
1118 if (check_stack_overrun(pc->thd, STACK_MIN_SIZE, &dummy)) return true;
1119 return head->contextualize(pc) || super::do_contextualize(pc);
1120 }
1121};
1122
1125
1129
1130 public:
1133 const POS &head_pos_arg,
1134 PT_option_value_list_head *tail_arg)
1135 : super(pos), head(head_arg), head_pos(head_pos_arg), tail(tail_arg) {}
1136
1137 bool do_contextualize(Parse_context *pc) override;
1138};
1139
1142
1143 const char *name;
1145
1146 public:
1147 PT_transaction_characteristic(const POS &pos, const char *name_arg,
1148 int32 value_arg)
1149 : super(pos), name(name_arg), value(value_arg) {}
1150
1151 bool do_contextualize(Parse_context *pc) override;
1152};
1153
1156
1157 public:
1158 explicit PT_transaction_access_mode(const POS &pos, bool is_read_only)
1159 : super(pos, "transaction_read_only", (int32)is_read_only) {}
1160};
1161
1164
1165 public:
1166 explicit PT_isolation_level(const POS &pos, enum_tx_isolation level)
1167 : super(pos, "transaction_isolation", (int32)level) {}
1168};
1169
1172
1175
1176 public:
1179 PT_transaction_characteristic *opt_tail_arg)
1180 : super(pos), head(head_arg), opt_tail(opt_tail_arg) {}
1181
1182 bool do_contextualize(Parse_context *pc) override {
1183 return (super::do_contextualize(pc) || head->contextualize(pc) ||
1184 (opt_tail != nullptr && opt_tail->contextualize(pc)));
1185 }
1186};
1187
1191
1194
1195 public:
1197 const POS &pos, PT_transaction_characteristics *characteristics_arg,
1198 const POS &end_pos_arg)
1199 : super(pos),
1200 characteristics(characteristics_arg),
1201 end_pos(end_pos_arg) {}
1202
1203 bool do_contextualize(Parse_context *pc) override;
1204};
1205
1207 : public Parse_tree_node {
1208 protected:
1210 : Parse_tree_node(pos) {}
1211};
1212
1216
1220
1221 public:
1223 const POS &pos, PT_set_scoped_system_variable *head_arg,
1224 const POS &head_pos_arg, PT_option_value_list_head *opt_tail_arg)
1225 : super(pos),
1226 head(head_arg),
1227 head_pos(head_pos_arg),
1228 opt_tail(opt_tail_arg) {}
1229
1230 bool do_contextualize(Parse_context *pc) override;
1231};
1232
1236
1239
1240 public:
1242 const POS &pos, PT_transaction_characteristics *characteristics_arg,
1243 const POS &characteristics_pos_arg)
1244 : super(pos),
1245 characteristics(characteristics_arg),
1246 characteristics_pos(characteristics_pos_arg) {}
1247
1248 bool do_contextualize(Parse_context *pc) override;
1249};
1250
1253
1256
1257 public:
1259 const POS &pos, enum_var_type type_arg,
1261 : super(pos), type(type_arg), list(list_arg) {}
1262
1263 bool do_contextualize(Parse_context *pc) override;
1264};
1265
1266class PT_set : public Parse_tree_node {
1268
1271
1272 public:
1273 PT_set(const POS &pos, const POS &set_pos_arg,
1275 : super(pos), set_pos(set_pos_arg), list(list_arg) {}
1276
1277 bool do_contextualize(Parse_context *pc) override;
1278};
1279
1282
1283 protected:
1284 explicit PT_into_destination(const POS &pos) : super(pos) {}
1285
1286 public:
1287 bool do_contextualize(Parse_context *pc) override;
1288};
1289
1292
1293 public:
1294 PT_into_destination_outfile(const POS &pos, const LEX_STRING &file_name_arg,
1295 const CHARSET_INFO *charset_arg,
1296 const Field_separators &field_term_arg,
1297 const Line_separators &line_term_arg)
1298 : PT_into_destination(pos), m_exchange(file_name_arg.str, false) {
1299 m_exchange.cs = charset_arg;
1300 m_exchange.field.merge_field_separators(field_term_arg);
1301 m_exchange.line.merge_line_separators(line_term_arg);
1302 }
1303
1304 bool do_contextualize(Parse_context *pc) override;
1305
1306 private:
1308};
1309
1312
1313 public:
1314 PT_into_destination_dumpfile(const POS &pos, const LEX_STRING &file_name_arg)
1315 : PT_into_destination(pos), m_exchange(file_name_arg.str, true) {}
1316
1317 bool do_contextualize(Parse_context *pc) override;
1318
1319 private:
1321};
1322
1324 public:
1326
1327 explicit PT_select_var(const POS &pos, const LEX_STRING &name_arg)
1328 : Parse_tree_node(pos), name(name_arg) {}
1329
1330 virtual bool is_local() const { return false; }
1331 virtual uint get_offset() const {
1332 assert(0);
1333 return 0;
1334 }
1335};
1336
1339
1340 uint offset = 0;
1341
1342#ifndef NDEBUG
1343 /*
1344 Routine to which this Item_splocal belongs. Used for checking if correct
1345 runtime context is used for variable handling.
1346 */
1347 sp_head *sp = nullptr;
1348#endif
1349
1350 public:
1351 PT_select_sp_var(const POS &pos, const LEX_STRING &name_arg)
1352 : super(pos, name_arg) {}
1353
1354 bool is_local() const override { return true; }
1355 uint get_offset() const override { return offset; }
1356
1357 bool do_contextualize(Parse_context *pc) override;
1358};
1359
1362
1363 public:
1364 explicit PT_select_var_list(const POS &pos) : PT_into_destination(pos) {}
1365
1367
1368 bool do_contextualize(Parse_context *pc) override;
1369
1370 bool push_back(PT_select_var *var) { return value.push_back(var); }
1371};
1372
1373/**
1374 Parse tree node for a single of a window extent's borders,
1375 cf. <window frame extent> in SQL 2003.
1376*/
1378 friend class Window;
1379 Item *m_value{nullptr}; ///< only relevant iff m_border_type == WBT_VALUE_*
1380 public:
1382 const bool m_date_time;
1383 interval_type m_int_type = INTERVAL_LAST; // clang-tidy needs initialization.
1384
1385 ///< For unbounded border
1389 }
1390
1391 ///< For bounded non-temporal border, e.g. 2 PRECEDING: 'value' is 2.
1393 : Parse_tree_node(pos),
1394 m_value(value),
1396 m_date_time(false) {}
1397
1398 ///< For bounded INTERVAL 2 DAYS, 'value' is 2, int_type is DAYS.
1400 interval_type int_type)
1401 : Parse_tree_node(pos),
1402 m_value(value),
1404 m_date_time(true),
1405 m_int_type(int_type) {}
1406
1407 ///< @returns the '2' in '2 PRECEDING' or 'INTERVAL 2 DAYS PRECEDING'
1408 Item *border() const { return m_value; }
1409 /// Need such low-level access so that fix_fields updates the right pointer
1410 Item **border_ptr() { return &m_value; }
1411
1412 /**
1413 @returns Addition operator for computation of frames, nullptr if error.
1414 @param order_expr Expression to add to/subtract from
1415 @param prec true if PRECEDING
1416 @param asc true if ASC
1417 @param window only used for error generation
1418 */
1419 Item *build_addop(Item_cache *order_expr, bool prec, bool asc,
1420 const Window *window);
1421
1422 bool do_contextualize(Parse_context *pc) override;
1423};
1424
1425/**
1426 Parse tree node for one or both of a window extent's borders, cf.
1427 <window frame extent> in SQL 2003.
1428*/
1431 friend class PT_frame;
1432
1433 public:
1434 /**
1435 Constructor.
1436
1437 Frames of the form "frame_start no_frame_end" are translated during
1438 parsing to "BETWEEN frame_start AND CURRENT ROW". So both 'start' and
1439 'end' are non-nullptr.
1440 */
1442 : Parse_tree_node(pos) {
1443 m_borders[0] = start;
1444 m_borders[1] = end;
1445 }
1446};
1447
1448/**
1449 Parse tree node for a window frame's exclusions, cf. the
1450 <window frame exclusion> clause in SQL 2003.
1451*/
1454
1455 public:
1457 : Parse_tree_node(pos), m_exclusion(e) {}
1458 // enum_window_frame_exclusion exclusion() { return m_exclusion; }
1459};
1460
1461/**
1462 Parse tree node for a window's frame, cf. the <window frame clause>
1463 in SQL 2003.
1464*/
1466 public:
1468
1471
1473
1474 /// If true, this is an artificial frame, not specified by the user
1476
1477 PT_frame(const POS &pos, enum_window_frame_unit unit, PT_borders *from_to,
1478 PT_exclusion *exclusion)
1479 : Parse_tree_node(pos),
1480 m_query_expression(unit),
1481 m_from(from_to->m_borders[0]),
1482 m_to(from_to->m_borders[1]),
1483 m_exclusion(exclusion) {}
1484
1485 bool do_contextualize(Parse_context *pc) override;
1486};
1487
1489 protected:
1490 explicit PT_query_primary(const POS &pos) : PT_query_expression_body(pos) {}
1491};
1492
1495
1507
1508 public:
1510 const POS &pos, PT_hint_list *opt_hints_arg,
1511 const Query_options &options_arg, PT_item_list *item_list_arg,
1512 PT_into_destination *opt_into1_arg,
1513 const Mem_root_array_YY<PT_table_reference *> &from_clause_arg,
1514 Item *opt_where_clause_arg, PT_group *opt_group_clause_arg,
1515 Item *opt_having_clause_arg, PT_window_list *opt_window_clause_arg,
1516 Item *opt_qualify_clause_arg, bool implicit_from_clause)
1517 : super(pos),
1518 opt_hints(opt_hints_arg),
1519 options(options_arg),
1520 item_list(item_list_arg),
1521 opt_into1(opt_into1_arg),
1522 m_is_from_clause_implicit{implicit_from_clause},
1523 from_clause(from_clause_arg),
1524 opt_where_clause(opt_where_clause_arg),
1525 opt_group_clause(opt_group_clause_arg),
1526 opt_having_clause(opt_having_clause_arg),
1527 opt_window_clause(opt_window_clause_arg),
1528 opt_qualify_clause(opt_qualify_clause_arg) {
1529 assert(implicit_from_clause ? from_clause.empty() : true);
1530 }
1531
1533 const POS &pos, const Query_options &options_arg,
1534 PT_item_list *item_list_arg,
1535 const Mem_root_array_YY<PT_table_reference *> &from_clause_arg,
1536 Item *opt_where_clause_arg)
1537 : super(pos),
1539 options(options_arg),
1540 item_list(item_list_arg),
1543 from_clause(from_clause_arg),
1544 opt_where_clause(opt_where_clause_arg),
1549
1550 PT_query_specification(const POS &pos, const Query_options &options_arg,
1551 PT_item_list *item_list_arg)
1552 : super(pos),
1554 options(options_arg),
1555 item_list(item_list_arg),
1558 from_clause{},
1564
1565 bool do_contextualize(Parse_context *pc) override;
1566
1567 bool has_into_clause() const override { return opt_into1 != nullptr; }
1568 bool has_trailing_into_clause() const override {
1570 opt_where_clause == nullptr && opt_group_clause == nullptr &&
1571 opt_having_clause == nullptr && opt_window_clause == nullptr &&
1572 opt_qualify_clause == nullptr);
1573 }
1574
1575 bool is_set_operation() const override { return false; }
1576
1577 bool can_absorb_order_and_limit(bool, bool) const override { return true; }
1578
1579 bool is_table_value_constructor() const override { return false; }
1580 PT_insert_values_list *get_row_value_list() const override { return nullptr; }
1581
1582 protected:
1583 void add_json_info(Json_object *obj) override;
1584
1585 private:
1587};
1588
1591
1593
1594 public:
1595 explicit PT_table_value_constructor(const POS &pos,
1596 PT_insert_values_list *row_value_list_arg)
1597 : super(pos), row_value_list(row_value_list_arg) {}
1598
1599 bool do_contextualize(Parse_context *pc) override;
1600
1601 bool has_into_clause() const override { return false; }
1602 bool has_trailing_into_clause() const override { return false; }
1603
1604 bool is_set_operation() const override { return false; }
1605
1606 bool can_absorb_order_and_limit(bool, bool) const override { return true; }
1607
1608 bool is_table_value_constructor() const override { return true; }
1609
1611 return row_value_list;
1612 }
1613};
1614
1617
1618 public:
1620 const POS &pos, const Query_options &options_arg,
1621 PT_item_list *item_list_arg,
1622 const Mem_root_array_YY<PT_table_reference *> &from_clause_arg)
1623 : super(pos, options_arg, item_list_arg, from_clause_arg, nullptr) {}
1624};
1625
1627 public:
1628 PT_query_expression(const POS &pos, PT_with_clause *with_clause,
1629 PT_query_expression_body *body, PT_order *order,
1630 PT_limit_clause *limit)
1632 m_body(body),
1633 m_order(order),
1634 m_limit(limit),
1635 m_with_clause(with_clause) {}
1636
1638 PT_order *order, PT_limit_clause *limit)
1639 : PT_query_expression(pos, nullptr, body, order, limit) {}
1640
1642 : PT_query_expression(pos, body, nullptr, nullptr) {}
1643
1644 bool do_contextualize(Parse_context *pc) override;
1645
1646 bool is_set_operation() const override { return m_body->is_set_operation(); }
1647
1648 bool has_into_clause() const override { return m_body->has_into_clause(); }
1649 bool has_trailing_into_clause() const override {
1650 return (m_body->has_trailing_into_clause() && m_order == nullptr &&
1651 m_limit == nullptr);
1652 }
1653
1658 return false;
1659 }
1660
1661 bool can_absorb_order_and_limit(bool order, bool limit) const override {
1662 if (m_body->is_set_operation()) {
1663 return false;
1664 }
1665 if (m_order == nullptr && m_limit == nullptr) {
1666 /*
1667 It is safe to push ORDER and/or LIMIT down in:
1668
1669 (SELECT ...<no order or limit clauses>) ORDER BY ... LIMIT ...;
1670 (SELECT ...<no order or limit clauses>) ORDER BY ...;
1671 (SELECT ...<no order or limit clauses>) LIMIT ...;
1672 */
1673 return true;
1674 }
1675 if (m_limit != nullptr && !order && limit) {
1676 /*
1677 In MySQL, it is ok(*) to push LIMIT down in:
1678
1679 (SELECT ... [ORDER BY ...] LIMIT a) LIMIT b;
1680
1681 *) MySQL doesn't follow the standard when overwriting `LIMIT a` with
1682 `LIMIT b` if a < b. Moreover, the result of:
1683
1684 (SELECT ... ORDER BY order1 LIMIT a) ORDER BY order1 LIMIT b; (1)
1685
1686 can diverge from:
1687
1688 (SELECT ... ORDER BY order1 LIMIT a) LIMIT b; (2)
1689
1690 since the example (1) never overwrites `LIMIT a` with `LIMIT b`,
1691 while the example (2) does overwrite.
1692
1693 TODO: add a warning, deprecate and replace this behavior with the
1694 standard one.
1695 */
1696 return true;
1697 }
1698 if (m_order != nullptr && m_limit == nullptr && !order && limit) {
1699 /*
1700 Allow pushdown of LIMIT into body with ORDER BY, e.g
1701
1702 (SELECT ... ORDER BY order1) LIMIT a;
1703 */
1704 return true;
1705 }
1706 return false;
1707 }
1708
1709 bool is_table_value_constructor() const override {
1711 }
1712
1714 return m_body->get_row_value_list();
1715 }
1716
1717 private:
1718 /**
1719 Contextualizes the order and limit clauses, re-interpreting them according
1720 to the rules. If the `<query expression body>` can absorb the clauses,
1721 they are simply contextualized into the current Query_block. If not, we
1722 have to create the "fake" Query_block unless there is one already
1723 (Query_expression::new_set_operation_query() is known to do this.)
1724
1725 @see PT_query_expression::can_absorb_order_and_limit()
1726 */
1728
1733};
1734
1735/*
1736 After the removal of the `... <locking_clause> <into_clause>` syntax
1737 PT_locking will disappear.
1738*/
1741
1742 public:
1744 PT_locking_clause_list *locking_clauses)
1745 : super(pos),
1747 m_locking_clauses{locking_clauses} {}
1748
1749 bool do_contextualize(Parse_context *pc) override {
1750 return (super::do_contextualize(pc) ||
1753 }
1754
1755 bool is_set_operation() const override {
1757 }
1758
1759 bool has_into_clause() const override {
1761 }
1762 bool has_trailing_into_clause() const override { return false; }
1763
1764 bool can_absorb_order_and_limit(bool order, bool limit) const override {
1765 return m_query_expression->can_absorb_order_and_limit(order, limit);
1766 }
1767
1768 bool is_table_value_constructor() const override {
1770 }
1771
1774 }
1775
1776 private:
1779};
1780
1783
1786
1787 public:
1789
1790 PT_subquery(const POS &pos, PT_query_expression_body *query_expression)
1791 : super(pos),
1792 qe(query_expression),
1794 m_is_derived_table(false) {}
1795
1796 bool do_contextualize(Parse_context *pc) override;
1797
1799};
1800
1803
1804 public:
1807 bool is_rhs_in_parentheses = false)
1808 : super(pos),
1810 m_is_rhs_in_parentheses{is_rhs_in_parentheses} {
1811 m_list.push_back(lhs);
1812 m_list.push_back(rhs);
1813 }
1814
1816 QueryLevel &ql);
1817 bool is_set_operation() const override { return true; }
1818
1819 bool has_into_clause() const override {
1820 return std::any_of(m_list.cbegin(), m_list.cend(),
1821 [](const PT_query_expression_body &body) {
1822 return body.has_into_clause();
1823 });
1824 }
1825 bool has_trailing_into_clause() const override {
1826 return !m_is_rhs_in_parentheses &&
1827 m_list[m_list.elements - 1]->has_trailing_into_clause();
1828 }
1829
1830 bool can_absorb_order_and_limit(bool, bool) const override { return false; }
1831
1832 bool is_table_value_constructor() const override { return false; }
1833 PT_insert_values_list *get_row_value_list() const override { return nullptr; }
1834 bool is_distinct() const { return m_is_distinct; }
1835
1838
1839 protected:
1841 Surrounding_context context);
1846 void add_json_info(Json_object *obj) override {
1847 obj->add_alias("distinct", create_dom_ptr<Json_boolean>(m_is_distinct));
1848 obj->add_alias("rhs_in_parentheses",
1849 create_dom_ptr<Json_boolean>(m_is_rhs_in_parentheses));
1850 }
1851};
1852
1855
1856 public:
1858 bool do_contextualize(Parse_context *pc) override;
1859 enum Setop_type type() const override { return UNION; }
1860};
1861
1864
1865 public:
1867 bool do_contextualize(Parse_context *pc) override;
1868 enum Setop_type type() const override { return EXCEPT; }
1869};
1870
1873
1874 public:
1876 bool do_contextualize(Parse_context *pc) override;
1877 enum Setop_type type() const override { return INTERSECT; }
1878};
1879
1882
1883 public:
1884 /**
1885 @param pos Position of this clause in the SQL statement.
1886 @param qe The query expression.
1887 @param sql_command The type of SQL command.
1888 */
1889 PT_select_stmt(const POS &pos, enum_sql_command sql_command,
1891 : super(pos),
1892 m_sql_command(sql_command),
1893 m_qe(qe),
1894 m_into(nullptr),
1896
1897 /**
1898 Creates a SELECT command. Only SELECT commands can have into.
1899
1900 @param pos Position of this clause in the SQL
1901 statement.
1902 @param qe The query expression.
1903 @param into The own INTO destination.
1904 @param has_trailing_locking_clauses True if there are locking clauses (like
1905 `FOR UPDATE`) at the end of the
1906 statement.
1907 */
1909 PT_into_destination *into = nullptr,
1910 bool has_trailing_locking_clauses = false)
1911 : super(pos),
1913 m_qe{qe},
1914 m_into{into},
1915 m_has_trailing_locking_clauses{has_trailing_locking_clauses} {}
1916
1917 Sql_cmd *make_cmd(THD *thd) override;
1918 std::string get_printable_parse_tree(THD *thd) override;
1919
1920 private:
1925};
1926
1927/**
1928 Top-level node for the DELETE statement
1929
1930 @ingroup ptn_stmt
1931*/
1932class PT_delete final : public Parse_tree_root {
1934
1935 private:
1940 const char *const opt_table_alias;
1948
1949 public:
1950 // single-table DELETE node constructor:
1951 PT_delete(const POS &pos, PT_with_clause *with_clause_arg,
1952 PT_hint_list *opt_hints_arg, int opt_delete_options_arg,
1953 Table_ident *table_ident_arg,
1954 const LEX_CSTRING &opt_table_alias_arg,
1955 List<String> *opt_use_partition_arg, Item *opt_where_clause_arg,
1956 PT_order *opt_order_clause_arg, Item *opt_delete_limit_clause_arg)
1957 : super(pos),
1958 m_with_clause(with_clause_arg),
1959 opt_hints(opt_hints_arg),
1960 opt_delete_options(opt_delete_options_arg),
1961 table_ident(table_ident_arg),
1962 opt_table_alias(opt_table_alias_arg.str),
1963 opt_use_partition(opt_use_partition_arg),
1964 opt_where_clause(opt_where_clause_arg),
1965 opt_order_clause(opt_order_clause_arg),
1966 opt_delete_limit_clause(opt_delete_limit_clause_arg) {
1968 join_table_list.init_empty_const();
1969 }
1970
1971 // multi-table DELETE node constructor:
1972 PT_delete(const POS &pos, PT_with_clause *with_clause_arg,
1973 PT_hint_list *opt_hints_arg, int opt_delete_options_arg,
1974 const Mem_root_array_YY<Table_ident *> &table_list_arg,
1975 const Mem_root_array_YY<PT_table_reference *> &join_table_list_arg,
1976 Item *opt_where_clause_arg)
1977 : super(pos),
1978 m_with_clause(with_clause_arg),
1979 opt_hints(opt_hints_arg),
1980 opt_delete_options(opt_delete_options_arg),
1983 table_list(table_list_arg),
1985 join_table_list(join_table_list_arg),
1986 opt_where_clause(opt_where_clause_arg),
1989
1990 Sql_cmd *make_cmd(THD *thd) override;
1991
1992 private:
1993 bool is_multitable() const {
1994 assert((table_ident != nullptr) ^ (table_list.size() > 0));
1995 return table_ident == nullptr;
1996 }
1997
1999};
2000
2001/**
2002 Top-level node for the UPDATE statement
2003
2004 @ingroup ptn_stmt
2005*/
2008
2019
2020 public:
2021 PT_update(const POS &pos, PT_with_clause *with_clause_arg,
2022 PT_hint_list *opt_hints_arg, thr_lock_type opt_low_priority_arg,
2023 bool opt_ignore_arg,
2024 const Mem_root_array_YY<PT_table_reference *> &join_table_list_arg,
2025 PT_item_list *column_list_arg, PT_item_list *value_list_arg,
2026 Item *opt_where_clause_arg, PT_order *opt_order_clause_arg,
2027 Item *opt_limit_clause_arg)
2028 : super(pos),
2029 m_with_clause(with_clause_arg),
2030 opt_hints(opt_hints_arg),
2031 opt_low_priority(opt_low_priority_arg),
2032 opt_ignore(opt_ignore_arg),
2033 join_table_list(join_table_list_arg),
2034 column_list(column_list_arg),
2035 value_list(value_list_arg),
2036 opt_where_clause(opt_where_clause_arg),
2037 opt_order_clause(opt_order_clause_arg),
2038 opt_limit_clause(opt_limit_clause_arg) {}
2039
2040 Sql_cmd *make_cmd(THD *thd) override;
2041};
2042
2045
2047
2048 public:
2050 : super(pos), many_values(mem_root) {}
2051
2052 bool do_contextualize(Parse_context *pc) override;
2053
2055 many_values.push_back(x);
2056 return false;
2057 }
2058
2060 assert(is_contextualized());
2061 return many_values;
2062 }
2063};
2064
2065/**
2066 Top-level node for the INSERT statement
2067
2068 @ingroup ptn_stmt
2069*/
2070class PT_insert final : public Parse_tree_root {
2072
2073 const bool is_replace;
2076 const bool ignore;
2082 const char *const opt_values_table_alias;
2086
2087 public:
2088 PT_insert(const POS &pos, bool is_replace_arg, PT_hint_list *opt_hints_arg,
2089 thr_lock_type lock_option_arg, bool ignore_arg,
2090 Table_ident *table_ident_arg, List<String> *opt_use_partition_arg,
2091 PT_item_list *column_list_arg,
2092 PT_insert_values_list *row_value_list_arg,
2093 PT_query_expression_body *insert_query_expression_arg,
2094 const LEX_CSTRING &opt_values_table_alias_arg,
2095 Create_col_name_list *opt_values_column_list_arg,
2096 PT_item_list *opt_on_duplicate_column_list_arg,
2097 PT_item_list *opt_on_duplicate_value_list_arg)
2098 : super(pos),
2099 is_replace(is_replace_arg),
2100 opt_hints(opt_hints_arg),
2101 lock_option(lock_option_arg),
2102 ignore(ignore_arg),
2103 table_ident(table_ident_arg),
2104 opt_use_partition(opt_use_partition_arg),
2105 column_list(column_list_arg),
2106 row_value_list(row_value_list_arg),
2107 insert_query_expression(insert_query_expression_arg),
2108 opt_values_table_alias(opt_values_table_alias_arg.str),
2109 opt_values_column_list(opt_values_column_list_arg),
2110 opt_on_duplicate_column_list(opt_on_duplicate_column_list_arg),
2111 opt_on_duplicate_value_list(opt_on_duplicate_value_list_arg) {
2112 // REPLACE statement can't have IGNORE flag:
2113 assert(!is_replace || !ignore);
2114 // REPLACE statement can't have ON DUPLICATE KEY UPDATE clause:
2115 assert(!is_replace || opt_on_duplicate_column_list == nullptr);
2116 // INSERT/REPLACE ... SELECT can't have VALUES clause:
2117 assert((row_value_list != nullptr) ^ (insert_query_expression != nullptr));
2118 // ON DUPLICATE KEY UPDATE: column and value arrays must have same sizes:
2119 assert((opt_on_duplicate_column_list == nullptr &&
2120 opt_on_duplicate_value_list == nullptr) ||
2123 }
2124
2125 Sql_cmd *make_cmd(THD *thd) override;
2126
2127 private:
2128 bool has_query_block() const { return insert_query_expression != nullptr; }
2129};
2130
2131class PT_call final : public Parse_tree_root {
2134
2135 public:
2136 PT_call(const POS &pos, sp_name *proc_name_arg,
2137 PT_item_list *opt_expr_list_arg)
2138 : Parse_tree_root(pos),
2139 proc_name(proc_name_arg),
2140 opt_expr_list(opt_expr_list_arg) {}
2141
2142 Sql_cmd *make_cmd(THD *thd) override;
2143};
2144
2145/**
2146 Top-level node for the SHUTDOWN statement
2147
2148 @ingroup ptn_stmt
2149*/
2150class PT_shutdown final : public Parse_tree_root {
2152
2153 public:
2154 Sql_cmd *make_cmd(THD *) override { return &sql_cmd; }
2155};
2156
2157/**
2158 Top-level node for the CREATE [OR REPLACE] SPATIAL REFERENCE SYSTEM statement.
2159
2160 @ingroup ptn_stmt
2161*/
2162class PT_create_srs final : public Parse_tree_root {
2163 /// The SQL command object.
2165 /// Whether OR REPLACE is specified.
2167 /// Whether IF NOT EXISTS is specified.
2169 /// SRID of the SRS to create.
2170 ///
2171 /// The range is larger than that of gis::srid_t, so it must be
2172 /// verified to be less than the uint32 maximum value.
2173 unsigned long long m_srid;
2174 /// All attributes except SRID.
2176
2177 /// Check if a UTF-8 string contains control characters.
2178 ///
2179 /// @note This function only checks single byte control characters (U+0000 to
2180 /// U+001F, and U+007F). There are some control characters at U+0080 to U+00A0
2181 /// that are not detected by this function.
2182 ///
2183 /// @param str The string.
2184 /// @param length Length of the string.
2185 ///
2186 /// @retval false The string contains no control characters.
2187 /// @retval true The string contains at least one control character.
2188 bool contains_control_char(char *str, size_t length) {
2189 for (size_t pos = 0; pos < length; pos++) {
2190 if (std::iscntrl(str[pos])) return true;
2191 }
2192 return false;
2193 }
2194
2195 public:
2196 PT_create_srs(const POS &pos, unsigned long long srid,
2197 const Sql_cmd_srs_attributes &attributes, bool or_replace,
2198 bool if_not_exists)
2199 : Parse_tree_root(pos),
2200 m_or_replace(or_replace),
2201 m_if_not_exists(if_not_exists),
2202 m_srid(srid),
2203 m_attributes(attributes) {}
2204
2205 Sql_cmd *make_cmd(THD *thd) override;
2206};
2207
2208/**
2209 Top-level node for the DROP SPATIAL REFERENCE SYSTEM statement.
2210
2211 @ingroup ptn_stmt
2212*/
2213class PT_drop_srs final : public Parse_tree_root {
2214 /// The SQL command object.
2216 /// SRID of the SRS to drop.
2217 ///
2218 /// The range is larger than that of gis::srid_t, so it must be
2219 /// verified to be less than the uint32 maximum value.
2220 unsigned long long m_srid;
2221
2222 public:
2223 PT_drop_srs(const POS &pos, unsigned long long srid, bool if_exists)
2224 : Parse_tree_root(pos), sql_cmd(srid, if_exists), m_srid(srid) {}
2225
2226 Sql_cmd *make_cmd(THD *thd) override;
2227};
2228
2229/**
2230 Top-level node for the ALTER INSTANCE statement
2231
2232 @ingroup ptn_stmt
2233*/
2236
2237 public:
2239 const POS &pos, enum alter_instance_action_enum alter_instance_action,
2240 const LEX_CSTRING &channel)
2241 : Parse_tree_root(pos), sql_cmd(alter_instance_action, channel) {}
2242
2243 Sql_cmd *make_cmd(THD *thd) override;
2244};
2245
2246/**
2247 A template-free base class for index options that we can predeclare in
2248 sql_lex.h
2249*/
2251 protected:
2252 explicit PT_base_index_option(const POS &pos) : Table_ddl_node(pos) {}
2253};
2254
2255/**
2256 A key part specification.
2257
2258 This can either be a "normal" key part (a key part that points to a column),
2259 or this can be a functional key part (a key part that points to an
2260 expression).
2261*/
2264
2265 public:
2266 /**
2267 Constructor for a functional key part.
2268
2269 @param pos Position of this clause in the SQL statement.
2270 @param expression The expression to index.
2271 @param order The direction of the index.
2272 */
2273 PT_key_part_specification(const POS &pos, Item *expression, enum_order order);
2274
2275 /**
2276 Constructor for a "normal" key part. That is a key part that points to a
2277 column and not an expression.
2278
2279 @param pos Position of this clause in the SQL statement.
2280 @param column_name The column name that this key part points to.
2281 @param order The direction of the index.
2282 @param prefix_length How many bytes or characters this key part should
2283 index, or zero if it should index the entire column.
2284 */
2285 PT_key_part_specification(const POS &pos, const LEX_CSTRING &column_name,
2286 enum_order order, int prefix_length);
2287
2288 /**
2289 Contextualize this key part specification. This will also call itemize on
2290 the indexed expression if this is a functional key part.
2291
2292 @param pc The parse context
2293
2294 @retval true on error
2295 @retval false on success
2296 */
2297 bool do_contextualize(Parse_context *pc) override;
2298
2299 /**
2300 Get the indexed expression. The caller must ensure that has_expression()
2301 returns true before calling this.
2302
2303 @returns The indexed expression
2304 */
2306 assert(has_expression());
2307 return m_expression;
2308 }
2309
2310 /**
2311 @returns The direction of the index: ORDER_ASC, ORDER_DESC or
2312 ORDER_NOT_RELEVANT in case the user didn't explicitly specify a
2313 direction.
2314 */
2315 enum_order get_order() const { return m_order; }
2316
2317 /**
2318 @retval true if the user explicitly specified a direction (asc/desc).
2319 @retval false if the user didn't explicitly specify a direction.
2320 */
2321 bool is_explicit() const { return get_order() != ORDER_NOT_RELEVANT; }
2322
2323 /**
2324 @retval true if the key part contains an expression (and thus is a
2325 functional key part).
2326 @retval false if the key part doesn't contain an expression.
2327 */
2328 bool has_expression() const { return m_expression != nullptr; }
2329
2330 /**
2331 Get the column that this key part points to. This is only valid if this
2332 key part isn't a functional index. The caller must thus check the return
2333 value of has_expression() before calling this function.
2334
2335 @returns The column that this key part points to.
2336 */
2338 assert(!has_expression());
2339 return m_column_name;
2340 }
2341
2342 /**
2343 @returns The number of bytes that this key part should index. If the column
2344 this key part points to is a non-binary column, this is the number
2345 of characters. Returns zero if the entire column should be indexed.
2346 */
2347 int get_prefix_length() const { return m_prefix_length; }
2348
2349 private:
2350 /**
2351 The indexed expression in case this is a functional key part. Only valid if
2352 has_expression() returns true.
2353 */
2355
2356 /// The direction of the index.
2358
2359 /// The name of the column that this key part indexes.
2361
2362 /**
2363 If this is greater than zero, it represents how many bytes of the column
2364 that is indexed. Note that for non-binary columns (VARCHAR, TEXT etc), this
2365 is the number of characters.
2366 */
2368};
2369
2370/**
2371 A template for options that set a single `<alter option>` value in
2372 thd->lex->key_create_info.
2373
2374 @tparam Option_type The data type of the option.
2375 @tparam Property Pointer-to-member for the option of KEY_CREATE_INFO.
2376*/
2377template <typename Option_type, Option_type KEY_CREATE_INFO::*Property>
2379 public:
2380 /// @param pos Position of this clause in the SQL statement.
2381 /// @param option_value The value of the option.
2382 PT_index_option(const POS &pos, Option_type option_value)
2383 : PT_base_index_option(pos), m_option_value(option_value) {}
2384
2387 return false;
2388 }
2389
2390 private:
2391 Option_type m_option_value;
2392};
2393
2394/**
2395 A template for options that set a single property in a KEY_CREATE_INFO, and
2396 also records if the option was explicitly set.
2397*/
2398template <typename Option_type, Option_type KEY_CREATE_INFO::*Property,
2399 bool KEY_CREATE_INFO::*Property_is_explicit>
2401 public:
2402 PT_traceable_index_option(const POS &pos, Option_type option_value)
2403 : PT_base_index_option(pos), m_option_value(option_value) {}
2404
2407 pc->key_create_info->*Property_is_explicit = true;
2408 return false;
2409 }
2410
2411 private:
2412 Option_type m_option_value;
2413};
2414
2422
2423/**
2424 The data structure (B-tree, Hash, etc) used for an index is called
2425 'index_type' in the manual. Internally, this is stored in
2426 KEY_CREATE_INFO::algorithm, while what the manual calls 'algorithm' is
2427 stored in partition_info::key_algorithm. In an `<create_index_stmt>`
2428 it's ignored. The terminology is somewhat confusing, but we stick to the
2429 manual in the parser.
2430*/
2434
2436 public:
2438 const LEX_STRING &name_arg, PT_base_index_option *type,
2439 Table_ident *table_ident,
2445 m_keytype(type_par),
2446 m_name(name_arg),
2447 m_type(type),
2448 m_table_ident(table_ident),
2449 m_columns(cols),
2451 m_algo(algo),
2452 m_lock(lock) {}
2453
2454 Sql_cmd *make_cmd(THD *thd) override;
2455
2456 private:
2465};
2466
2467/**
2468 Base class for column/constraint definitions in CREATE %TABLE
2469
2470 @ingroup ptn_create_table_stuff
2471*/
2473 protected:
2474 explicit PT_table_element(const POS &pos) : Table_ddl_node(pos) {}
2475};
2476
2478 protected:
2479 explicit PT_table_constraint_def(const POS &pos) : PT_table_element(pos) {}
2480};
2481
2484
2485 public:
2487 const LEX_STRING &name_arg,
2491 : super(pos),
2492 m_keytype(type_par),
2493 m_name(name_arg),
2494 m_type(type),
2495 m_columns(cols),
2496 m_options(options) {}
2497
2498 bool do_contextualize(Table_ddl_parse_context *pc) override;
2499
2500 private:
2506};
2507
2510
2511 public:
2512 PT_foreign_key_definition(const POS &pos, const LEX_STRING &constraint_name,
2513 const LEX_STRING &key_name,
2515 Table_ident *referenced_table,
2516 List<Key_part_spec> *ref_list,
2517 fk_match_opt fk_match_option,
2518 fk_option fk_update_opt, fk_option fk_delete_opt)
2519 : super(pos),
2520 m_constraint_name(constraint_name),
2521 m_key_name(key_name),
2522 m_columns(columns),
2523 m_referenced_table(referenced_table),
2524 m_ref_list(ref_list),
2525 m_fk_match_option(fk_match_option),
2526 m_fk_update_opt(fk_update_opt),
2527 m_fk_delete_opt(fk_delete_opt) {}
2528
2529 bool do_contextualize(Table_ddl_parse_context *pc) override;
2530
2531 private:
2540};
2541
2542/**
2543 Common base class for CREATE TABLE and ALTER TABLE option nodes
2544
2545 @ingroup ptn_create_or_alter_table_options
2546*/
2548 protected:
2549 explicit PT_ddl_table_option(const POS &pos) : Table_ddl_node(pos) {}
2550
2551 public:
2552 ~PT_ddl_table_option() override = 0; // Force abstract class declaration
2553
2554 virtual bool is_rename_table() const { return false; }
2555};
2556
2558
2559/**
2560 Base class for CREATE TABLE option nodes
2561
2562 @ingroup ptn_create_or_alter_table_options
2563*/
2566
2567 protected:
2568 explicit PT_create_table_option(const POS &pos) : super(pos) {}
2569
2570 public:
2571 ~PT_create_table_option() override = 0; // Force abstract class declaration
2572
2574 if (super::do_contextualize(pc)) return true;
2576 return false;
2577 }
2578};
2579
2581
2582/**
2583 A template for options that set a single property in HA_CREATE_INFO, and
2584 also records if the option was explicitly set.
2585*/
2586template <typename Option_type, Option_type HA_CREATE_INFO::*Property,
2587 uint64_t Property_flag>
2590
2591 const Option_type value;
2592
2593 public:
2594 explicit PT_traceable_create_table_option(const POS &pos, Option_type value)
2595 : super(pos), value(value) {}
2596
2598 if (super::do_contextualize(pc)) return true;
2599 pc->create_info->*Property = value;
2600 pc->create_info->used_fields |= Property_flag;
2601 return false;
2602 }
2603};
2604
2605#define TYPE_AND_REF(x) decltype(x), &x
2606
2607/**
2608 Node for the @SQL{MAX_ROWS [=] @B{@<integer@>}} table option
2609
2610 @ingroup ptn_create_or_alter_table_options
2611*/
2615
2616/**
2617 Node for the @SQL{MIN_ROWS [=] @B{@<integer@>}} table option
2618
2619 @ingroup ptn_create_or_alter_table_options
2620*/
2624
2625/**
2626 Node for the @SQL{AVG_ROW_LENGTH_ROWS [=] @B{@<integer@>}} table option
2627
2628 @ingroup ptn_create_or_alter_table_options
2629*/
2633
2634/**
2635 Node for the @SQL{PASSWORD [=] @B{@<string@>}} table option
2636
2637 @ingroup ptn_create_or_alter_table_options
2638*/
2642
2643/**
2644 Node for the @SQL{COMMENT [=] @B{@<string@>}} table option
2645
2646 @ingroup ptn_create_or_alter_table_options
2647*/
2651
2652/**
2653 Node for the @SQL{COMPRESSION [=] @B{@<string@>}} table option
2654
2655 @ingroup ptn_create_or_alter_table_options
2656*/
2660
2661/**
2662 Node for the @SQL{ENGRYPTION [=] @B{@<string@>}} table option
2663
2664 @ingroup ptn_create_or_alter_table_options
2665*/
2669
2670/**
2671 Node for the @SQL{AUTO_INCREMENT [=] @B{@<integer@>}} table option
2672
2673 @ingroup ptn_create_or_alter_table_options
2674*/
2678
2682
2687
2691
2695
2699
2703
2707
2712
2717
2719
2720/**
2721 A template for options that set HA_CREATE_INFO::table_options and
2722 also records if the option was explicitly set.
2723*/
2724template <ulong Property_flag, table_options_t Default, table_options_t Yes,
2725 table_options_t No>
2728
2730
2731 public:
2733 : super(pos), value(value) {}
2734
2736 if (super::do_contextualize(pc)) return true;
2737 pc->create_info->table_options &= ~(Yes | No);
2738 switch (value) {
2739 case Ternary_option::ON:
2740 pc->create_info->table_options |= Yes;
2741 break;
2743 pc->create_info->table_options |= No;
2744 break;
2746 break;
2747 default:
2748 assert(false);
2749 }
2750 pc->create_info->used_fields |= Property_flag;
2751 return false;
2752 }
2753};
2754
2755/**
2756 Node for the @SQL{PACK_KEYS [=] @B{1|0|DEFAULT}} table option
2757
2758 @ingroup ptn_create_or_alter_table_options
2759
2760 PACK_KEYS | Constructor parameter
2761 ----------|----------------------
2762 1 | Ternary_option::ON
2763 0 | Ternary_option::OFF
2764 DEFAULT | Ternary_option::DEFAULT
2765*/
2767 0, // DEFAULT
2768 HA_OPTION_PACK_KEYS, // ON
2771
2772/**
2773 Node for the @SQL{STATS_PERSISTENT [=] @B{1|0|DEFAULT}} table option
2774
2775 @ingroup ptn_create_or_alter_table_options
2776
2777 STATS_PERSISTENT | Constructor parameter
2778 -----------------|----------------------
2779 1 | Ternary_option::ON
2780 0 | Ternary_option::OFF
2781 DEFAULT | Ternary_option::DEFAULT
2782*/
2784 0, // DEFAULT
2788
2789/**
2790 A template for options that set HA_CREATE_INFO::table_options and
2791 also records if the option was explicitly set.
2792*/
2793template <ulong Property_flag, table_options_t Yes, table_options_t No>
2796
2797 const bool value;
2798
2799 public:
2800 explicit PT_bool_create_table_option(const POS &pos, bool value)
2801 : super(pos), value(value) {}
2802
2804 if (super::do_contextualize(pc)) return true;
2805 pc->create_info->table_options &= ~(Yes | No);
2806 pc->create_info->table_options |= value ? Yes : No;
2807 pc->create_info->used_fields |= Property_flag;
2808 return false;
2809 }
2810};
2811
2812/**
2813 Node for the @SQL{CHECKSUM|TABLE_CHECKSUM [=] @B{0|@<not 0@>}} table option
2814
2815 @ingroup ptn_create_or_alter_table_options
2816
2817 TABLE_CHECKSUM | Constructor parameter
2818 ---------------|----------------------
2819 0 | false
2820 not 0 | true
2821*/
2823 HA_OPTION_CHECKSUM, // ON
2825 >
2827
2828/**
2829 Node for the @SQL{DELAY_KEY_WRITE [=] @B{0|@<not 0@>}} table option
2830
2831 @ingroup ptn_create_or_alter_table_options
2832
2833 TABLE_CHECKSUM | Constructor parameter
2834 ---------------|----------------------
2835 0 | false
2836 not 0 | true
2837*/
2842
2843/**
2844 Node for the @SQL{ENGINE [=] @B{@<identifier@>|@<string@>}} table option
2845
2846 @ingroup ptn_create_or_alter_table_options
2847*/
2850
2852
2853 public:
2854 /**
2855 @param pos Position of this clause in the SQL statement.
2856 @param engine Storage engine name.
2857 */
2859 const LEX_CSTRING &engine)
2860 : super(pos), engine(engine) {}
2861
2862 bool do_contextualize(Table_ddl_parse_context *pc) override;
2863};
2864
2865/**
2866 Node for the @SQL{SECONDARY_ENGINE [=] @B{@<identifier@>|@<string@>|NULL}}
2867 table option.
2868
2869 @ingroup ptn_create_or_alter_table_options
2870*/
2873
2874 public:
2876 : super(pos) {}
2878 const POS &pos, const LEX_CSTRING &secondary_engine)
2880
2881 bool do_contextualize(Table_ddl_parse_context *pc) override;
2882
2883 private:
2885};
2886
2887/**
2888 Node for the @SQL{STATS_AUTO_RECALC [=] @B{@<0|1|DEFAULT@>})} table option
2889
2890 @ingroup ptn_create_or_alter_table_options
2891*/
2894
2896
2897 public:
2898 /**
2899 @param pos Position of this clause in the SQL statement.
2900 @param value
2901 STATS_AUTO_RECALC | value
2902 ------------------|----------------------
2903 1 | Ternary_option::ON
2904 0 | Ternary_option::OFF
2905 DEFAULT | Ternary_option::DEFAULT
2906 */
2908 : super(pos), value(value) {}
2909
2910 bool do_contextualize(Table_ddl_parse_context *pc) override;
2911};
2912
2913/**
2914 Node for the @SQL{STATS_SAMPLE_PAGES [=] @B{@<integer@>|DEFAULT}} table option
2915
2916 @ingroup ptn_create_or_alter_table_options
2917*/
2921
2923
2924 public:
2925 /**
2926 Constructor for implicit number of pages
2927
2928 @param pos Position of this clause in the SQL statement.
2929 @param value Number of pages, 1@<=N@<=65535.
2930 */
2932 : super(pos), value(value) {
2933 assert(value != 0 && value <= 0xFFFF);
2934 }
2935 /**
2936 Constructor for the DEFAULT number of pages
2937 */
2939 : super(pos), value(0) {} // DEFAULT
2940
2941 bool do_contextualize(Table_ddl_parse_context *pc) override;
2942};
2943
2946
2948
2949 public:
2950 explicit PT_create_union_option(const POS &pos,
2952 : super(pos), tables(tables) {}
2953
2954 bool do_contextualize(Table_ddl_parse_context *pc) override;
2955};
2956
2959
2961
2962 public:
2964 : super(pos), value(value) {}
2965
2967 if (super::do_contextualize(pc)) return true;
2969 return false;
2970 }
2971};
2972
2975
2977
2978 public:
2980 const CHARSET_INFO *value)
2981 : super(pos), value(value) {
2982 assert(value != nullptr);
2983 }
2984
2985 bool do_contextualize(Table_ddl_parse_context *pc) override;
2986};
2987
2990
2992
2993 public:
2995 const CHARSET_INFO *value)
2996 : super(pos), value(value) {
2997 assert(value != nullptr);
2998 }
2999
3000 bool do_contextualize(Table_ddl_parse_context *pc) override;
3001};
3002
3006
3007 public:
3008 explicit PT_check_constraint(const POS &pos, LEX_STRING &name, Item *expr,
3009 bool is_enforced)
3010 : super(pos) {
3011 cc_spec.name = name;
3012 cc_spec.check_expr = expr;
3013 cc_spec.is_enforced = is_enforced;
3014 }
3016
3017 bool do_contextualize(Table_ddl_parse_context *pc) override;
3018};
3019
3022
3025 // Currently we ignore that constraint in the executor.
3027
3028 const char *opt_place;
3029
3030 public:
3034 const char *opt_place = nullptr)
3035 : super(pos),
3040
3041 bool do_contextualize(Table_ddl_parse_context *pc) override;
3042};
3043
3044/**
3045 Top-level node for the CREATE %TABLE statement
3046
3047 @ingroup ptn_create_table
3048*/
3059
3061
3062 public:
3063 /**
3064 @param pos Position of this clause in the SQL
3065 statement.
3066 @param mem_root MEM_ROOT to use for allocation
3067 @param is_temporary True if @SQL{CREATE @B{TEMPORARY} %TABLE}
3068 @param only_if_not_exists True if @SQL{CREATE %TABLE ... @B{IF NOT EXISTS}}
3069 @param table_name @SQL{CREATE %TABLE ... @B{@<table name@>}}
3070 @param opt_table_element_list NULL or a list of table column and
3071 constraint definitions.
3072 @param opt_create_table_options NULL or a list of
3073 @ref ptn_create_or_alter_table_options
3074 "table options".
3075 @param opt_partitioning NULL or the @SQL{PARTITION BY} clause.
3076 @param on_duplicate DUPLICATE, IGNORE or fail with an error
3077 on data duplication errors (relevant
3078 for @SQL{CREATE TABLE ... SELECT}
3079 statements).
3080 @param opt_query_expression NULL or the @SQL{@B{SELECT}} clause.
3081 */
3083 const POS &pos, MEM_ROOT *mem_root, bool is_temporary,
3099 /**
3100 @param pos Position of this clause in the SQL statement.
3101 @param mem_root MEM_ROOT to use for allocation
3102 @param is_temporary True if @SQL{CREATE @B{TEMPORARY} %TABLE}.
3103 @param only_if_not_exists True if @SQL{CREATE %TABLE ... @B{IF NOT EXISTS}}.
3104 @param table_name @SQL{CREATE %TABLE ... @B{@<table name@>}}.
3105 @param opt_like_clause NULL or the @SQL{@B{LIKE @<table name@>}} clause.
3106 */
3120
3121 Sql_cmd *make_cmd(THD *thd) override;
3122};
3123
3124class PT_create_role final : public Parse_tree_root {
3126
3127 public:
3128 PT_create_role(const POS &pos, bool if_not_exists,
3129 const List<LEX_USER> *roles)
3130 : Parse_tree_root(pos), sql_cmd(if_not_exists, roles) {}
3131
3132 Sql_cmd *make_cmd(THD *thd) override;
3133};
3134
3135class PT_drop_role final : public Parse_tree_root {
3137
3138 public:
3139 explicit PT_drop_role(const POS &pos, bool ignore_errors,
3140 const List<LEX_USER> *roles)
3141 : Parse_tree_root(pos), sql_cmd(ignore_errors, roles) {}
3142
3143 Sql_cmd *make_cmd(THD *thd) override;
3144};
3145
3148
3149 public:
3150 explicit PT_set_role(const POS &pos, role_enum role_type,
3151 const List<LEX_USER> *opt_except_roles = nullptr)
3152 : Parse_tree_root(pos), sql_cmd(role_type, opt_except_roles) {
3153 assert(role_type == role_enum::ROLE_ALL || opt_except_roles == nullptr);
3154 }
3155 explicit PT_set_role(const POS &pos, const List<LEX_USER> *roles)
3156 : Parse_tree_root(pos), sql_cmd(roles) {}
3157
3158 Sql_cmd *make_cmd(THD *thd) override;
3159};
3160
3161/**
3162 This class is used for representing both static and dynamic privileges on
3163 global as well as table and column level.
3164*/
3167
3170
3173 : type(type), columns(columns) {}
3174};
3175
3177 const uint grant;
3178
3180 : Privilege(STATIC, columns_arg), grant(grant) {}
3181};
3182
3185
3187 const Mem_root_array<LEX_CSTRING> *columns_arg)
3188 : Privilege(DYNAMIC, columns_arg), ident(ident) {}
3189};
3190
3192 private:
3194
3195 public:
3196 explicit PT_role_or_privilege(const POS &pos, const POS &errpos)
3197 : Parse_tree_node(pos), m_errpos(errpos) {}
3198 virtual LEX_USER *get_user(THD *thd);
3199 virtual Privilege *get_privilege(THD *thd);
3200};
3201
3205
3206 public:
3207 PT_role_at_host(const POS &pos, const POS &errpos, const LEX_STRING &role,
3208 const LEX_STRING &host)
3209 : PT_role_or_privilege(pos, errpos), role(role), host(host) {}
3210
3211 LEX_USER *get_user(THD *thd) override;
3212};
3213
3216
3217 public:
3218 PT_role_or_dynamic_privilege(const POS &pos, const POS &errpos,
3219 const LEX_STRING &ident)
3220 : PT_role_or_privilege(pos, errpos), ident(ident) {}
3221
3222 LEX_USER *get_user(THD *thd) override;
3223 Privilege *get_privilege(THD *thd) override;
3224};
3225
3227 const uint grant;
3229
3230 public:
3231 PT_static_privilege(const POS &pos, const POS &errpos, uint grant,
3232 const Mem_root_array<LEX_CSTRING> *columns = nullptr)
3233 : PT_role_or_privilege(pos, errpos), grant(grant), columns(columns) {}
3234
3235 Privilege *get_privilege(THD *thd) override;
3236};
3237
3240
3241 public:
3242 PT_dynamic_privilege(const POS &pos, const POS &errpos,
3243 const LEX_STRING &ident)
3244 : PT_role_or_privilege(pos, errpos), ident(ident) {}
3245
3246 Privilege *get_privilege(THD *thd) override;
3247};
3248
3249class PT_grant_roles final : public Parse_tree_root {
3253
3254 public:
3258 : Parse_tree_root(pos),
3259 roles(roles),
3260 users(users),
3262
3263 Sql_cmd *make_cmd(THD *thd) override;
3264};
3265
3266class PT_revoke_roles final : public Parse_tree_root {
3269
3270 public:
3272 const List<LEX_USER> *users)
3273 : Parse_tree_root(pos), roles(roles), users(users) {}
3274
3275 Sql_cmd *make_cmd(THD *thd) override;
3276};
3277
3280
3281 public:
3282 PT_alter_user_default_role(const POS &pos, bool if_exists,
3283 const List<LEX_USER> *users,
3284 const List<LEX_USER> *roles,
3285 const role_enum role_type)
3286 : Parse_tree_root(pos), sql_cmd(if_exists, users, roles, role_type) {}
3287
3288 Sql_cmd *make_cmd(THD *thd) override;
3289};
3290
3291/// Base class for Parse tree nodes of SHOW statements
3292
3294 protected:
3295 PT_show_base(const POS &pos, enum_sql_command sql_command)
3296 : Parse_tree_root(pos), m_sql_command(sql_command) {}
3297
3298 /// SQL command
3300};
3301
3302/// Base class for Parse tree nodes of SHOW statements with LIKE/WHERE parameter
3303
3305 protected:
3307 const LEX_STRING &wild, Item *where)
3308 : PT_show_base(pos, sql_command), m_wild(wild), m_where(where) {
3309 assert(m_wild.str == nullptr || m_where == nullptr);
3310 }
3311 /// Wild or where clause used in the statement.
3314};
3315
3316/// Base class for Parse tree nodes of SHOW statements with schema parameter.
3317
3319 protected:
3321 char *opt_db, const LEX_STRING &wild, Item *where)
3322 : PT_show_base(pos, sql_command),
3324 m_wild(wild),
3325 m_where(where) {
3326 assert(m_wild.str == nullptr || m_where == nullptr);
3327 }
3328 /// Optional schema name in FROM/IN clause.
3330 /// Wild or where clause used in the statement.
3333};
3334
3335/// Base class for Parse tree nodes of SHOW COLUMNS/SHOW INDEX statements.
3336
3338 protected:
3339 PT_show_table_base(const POS &pos, enum_sql_command sql_command,
3340 Table_ident *table_ident, const LEX_STRING &wild,
3341 Item *where)
3342 : PT_show_filter_base(pos, sql_command, wild, where),
3343 m_table_ident(table_ident) {}
3344
3345 bool make_table_base_cmd(THD *thd, bool *temporary);
3346
3347 /// Table used in the statement.
3349};
3350
3351/// Parse tree node for SHOW FUNCTION/PROCEDURE CODE statements.
3352
3354 protected:
3356 const sp_name *routine_name)
3357 : PT_show_base(pos, sql_command), m_sql_cmd(sql_command, routine_name) {}
3358
3359 Sql_cmd *make_cmd(THD *thd) override;
3360
3361 private:
3363};
3364
3365/// Parse tree node for SHOW BINLOG EVENTS statement
3366
3368 public:
3369 PT_show_binlog_events(const POS &pos, const LEX_STRING opt_log_file_name = {},
3370 PT_limit_clause *opt_limit_clause = nullptr)
3372 m_opt_log_file_name(opt_log_file_name),
3373 m_opt_limit_clause(opt_limit_clause) {}
3374
3375 Sql_cmd *make_cmd(THD *thd) override;
3376
3377 private:
3380
3382};
3383
3384/// Parse tree node for SHOW BINLOGS statement
3385
3386class PT_show_binlogs final : public PT_show_base {
3387 public:
3389
3390 Sql_cmd *make_cmd(THD *thd) override;
3391
3392 private:
3394};
3395
3396/// Parse tree node for SHOW CHARACTER SET statement
3397
3399 public:
3400 PT_show_charsets(const POS &pos, const LEX_STRING &wild, Item *where)
3402
3403 Sql_cmd *make_cmd(THD *thd) override;
3404
3405 private:
3407};
3408
3409/// Parse tree node for SHOW COLLATIONS statement
3410
3412 public:
3413 PT_show_collations(const POS &pos, const LEX_STRING &wild, Item *where)
3415
3416 Sql_cmd *make_cmd(THD *thd) override;
3417
3418 private:
3420};
3421
3422/// Base class for Parse tree nodes of SHOW COUNT(*) { WARNINGS | ERRORS }
3423/// statements.
3424
3426 public:
3427 explicit PT_show_count_base(const POS &pos)
3428 : PT_show_base{pos, SQLCOM_SELECT} {}
3429
3430 protected:
3431 Sql_cmd *make_cmd_generic(THD *thd, LEX_CSTRING diagnostic_variable_name);
3432};
3433
3434/// Parse tree node for SHOW COUNT(*) ERRORS
3435
3437 public:
3438 explicit PT_show_count_errors(const POS &pos) : PT_show_count_base(pos) {}
3439
3440 Sql_cmd *make_cmd(THD *thd) override {
3441 return make_cmd_generic(thd, LEX_CSTRING{STRING_WITH_LEN("error_count")});
3442 }
3443};
3444
3445/// Parse tree node for SHOW COUNT(*) WARNINGS
3446
3448 public:
3449 explicit PT_show_count_warnings(const POS &pos) : PT_show_count_base(pos) {}
3450
3451 Sql_cmd *make_cmd(THD *thd) override {
3452 return make_cmd_generic(thd, LEX_CSTRING{STRING_WITH_LEN("warning_count")});
3453 }
3454};
3455
3456/// Parse tree node for SHOW CREATE DATABASE statement
3457
3459 public:
3460 PT_show_create_database(const POS &pos, bool if_not_exists,
3461 const LEX_STRING &name)
3463 m_if_not_exists(if_not_exists),
3464 m_name(name) {}
3465
3466 Sql_cmd *make_cmd(THD *thd) override;
3467
3468 private:
3471
3473};
3474
3475/// Parse tree node for SHOW CREATE EVENT statement
3476
3478 public:
3479 PT_show_create_event(const POS &pos, sp_name *event_name)
3480 : PT_show_base(pos, SQLCOM_SHOW_CREATE_EVENT), m_spname(event_name) {}
3481
3482 Sql_cmd *make_cmd(THD *thd) override;
3483
3484 private:
3486
3488};
3489
3490/// Parse tree node for SHOW CREATE FUNCTION statement
3491
3493 public:
3494 PT_show_create_function(const POS &pos, sp_name *function_name)
3495 : PT_show_base(pos, SQLCOM_SHOW_CREATE_FUNC), m_spname(function_name) {}
3496
3497 Sql_cmd *make_cmd(THD *thd) override;
3498
3499 private:
3501
3503};
3504
3505/// Parse tree node for SHOW CREATE PROCEDURE statement
3506
3508 public:
3509 PT_show_create_procedure(const POS &pos, sp_name *procedure_name)
3510 : PT_show_base(pos, SQLCOM_SHOW_CREATE_PROC), m_spname(procedure_name) {}
3511
3512 Sql_cmd *make_cmd(THD *thd) override;
3513
3514 private:
3516
3518};
3519
3520/// Parse tree node for SHOW CREATE TABLE and VIEW statements
3521
3523 public:
3524 PT_show_create_table(const POS &pos, Table_ident *table_ident)
3525 : PT_show_base(pos, SQLCOM_SHOW_CREATE), m_sql_cmd(false, table_ident) {}
3526
3527 Sql_cmd *make_cmd(THD *thd) override;
3528
3529 private:
3531};
3532
3533/// Parse tree node for SHOW CREATE TRIGGER statement
3534
3536 public:
3537 PT_show_create_trigger(const POS &pos, sp_name *trigger_name)
3538 : PT_show_base(pos, SQLCOM_SHOW_CREATE_TRIGGER), m_spname(trigger_name) {}
3539
3540 Sql_cmd *make_cmd(THD *thd) override;
3541
3542 private:
3544
3546};
3547
3548/// Parse tree node for SHOW CREATE USER statement
3549
3550class PT_show_create_user final : public PT_show_base {
3551 public:
3554
3555 Sql_cmd *make_cmd(THD *thd) override;
3556
3557 private:
3559
3561};
3562
3563/// Parse tree node for SHOW CREATE VIEW statement
3564
3565class PT_show_create_view final : public PT_show_base {
3566 public:
3567 PT_show_create_view(const POS &pos, Table_ident *table_ident)
3568 : PT_show_base(pos, SQLCOM_SHOW_CREATE), m_sql_cmd(true, table_ident) {}
3569
3570 Sql_cmd *make_cmd(THD *thd) override;
3571
3572 private:
3574};
3575
3576/// Parse tree node for SHOW DATABASES statement
3577
3579 public:
3580 PT_show_databases(const POS &pos, const LEX_STRING &wild, Item *where)
3582
3583 Sql_cmd *make_cmd(THD *thd) override;
3584
3585 private:
3587};
3588
3589/// Parse tree node for SHOW ENGINE statements
3590
3592 protected:
3593 PT_show_engine_base(const POS &pos, enum enum_sql_command sql_command,
3594 const LEX_STRING opt_engine = {})
3595 : PT_show_base(pos, sql_command),
3596 m_engine(opt_engine),
3597 m_all(opt_engine.str == nullptr) {}
3598
3600 bool m_all;
3601};
3602
3603/// Parse tree node for SHOW ENGINE LOGS statement
3604
3606 public:
3607 PT_show_engine_logs(const POS &pos, LEX_STRING opt_engine = {})
3608 : PT_show_engine_base(pos, SQLCOM_SHOW_ENGINE_LOGS, opt_engine) {}
3609
3610 Sql_cmd *make_cmd(THD *thd) override;
3611
3612 private:
3614};
3615
3616/// Parse tree node for SHOW ENGINE MUTEX statement
3617
3619 public:
3620 PT_show_engine_mutex(const POS &pos, LEX_STRING opt_engine = {})
3621 : PT_show_engine_base(pos, SQLCOM_SHOW_ENGINE_MUTEX, opt_engine) {}
3622
3623 Sql_cmd *make_cmd(THD *thd) override;
3624
3625 private:
3627};
3628
3629/// Parse tree node for SHOW ENGINE STATUS statement
3630
3632 public:
3633 PT_show_engine_status(const POS &pos, LEX_STRING opt_engine = {})
3634 : PT_show_engine_base(pos, SQLCOM_SHOW_ENGINE_STATUS, opt_engine) {}
3635
3636 Sql_cmd *make_cmd(THD *thd) override;
3637
3638 private:
3640};
3641
3642/// Parse tree node for SHOW ENGINES statement
3643
3644class PT_show_engines final : public PT_show_base {
3645 public:
3648
3649 Sql_cmd *make_cmd(THD *thd) override;
3650
3651 private:
3653};
3654
3655/// Parse tree node for SHOW ERRORS statement
3656
3657class PT_show_errors final : public PT_show_base {
3658 public:
3659 PT_show_errors(const POS &pos, PT_limit_clause *opt_limit_clause = nullptr)
3661 m_opt_limit_clause(opt_limit_clause) {}
3662
3663 Sql_cmd *make_cmd(THD *thd) override;
3664
3665 private:
3667
3669};
3670
3671/// Parse tree node for SHOW EVENTS statement
3672
3674 public:
3675 PT_show_events(const POS &pos, char *opt_db, const LEX_STRING &wild,
3676 Item *where)
3678
3679 Sql_cmd *make_cmd(THD *thd) override;
3680
3681 private:
3683};
3684
3685/// Parse tree node for SHOW COLUMNS statement.
3686
3689
3690 public:
3691 PT_show_fields(const POS &pos, Show_cmd_type show_cmd_type,
3692 Table_ident *table, LEX_STRING opt_wild = {},
3693 Item *opt_where = nullptr)
3694 : PT_show_table_base(pos, SQLCOM_SHOW_FIELDS, table, opt_wild, opt_where),
3695 m_show_cmd_type(show_cmd_type) {}
3696
3697 Sql_cmd *make_cmd(THD *thd) override;
3698
3699 private:
3702};
3703
3704/// Parse tree node for SHOW FUNCTION CODE statement.
3705
3707 public:
3708 PT_show_function_code(const POS &pos, const sp_name *function_name)
3709 : PT_show_routine_code(pos, SQLCOM_SHOW_FUNC_CODE, function_name) {}
3710};
3711
3712/// Parse tree node for SHOW GRANTS statement.
3713
3714class PT_show_grants final : public PT_show_base {
3715 public:
3716 PT_show_grants(const POS &pos, const LEX_USER *opt_for_user,
3717 const List<LEX_USER> *opt_using_users)
3719 sql_cmd(opt_for_user, opt_using_users) {
3720 assert(opt_using_users == nullptr || opt_for_user != nullptr);
3721 }
3722
3723 Sql_cmd *make_cmd(THD *thd) override;
3724
3725 private:
3727};
3728
3729/// Parse tree node for SHOW INDEX statement.
3730
3731class PT_show_keys final : public PT_show_table_base {
3732 public:
3733 PT_show_keys(const POS &pos, bool extended_show, Table_ident *table,
3734 Item *where)
3736 m_extended_show(extended_show) {}
3737
3738 Sql_cmd *make_cmd(THD *thd) override;
3739
3740 private:
3742
3743 // Flag to indicate EXTENDED keyword usage in the statement.
3746};
3747
3748/// Parse tree node for SHOW BINARY LOG STATUS statement
3749
3751 public:
3754
3755 Sql_cmd *make_cmd(THD *thd) override;
3756
3757 private:
3759};
3760
3761/// Parse tree node for SHOW OPEN TABLES statement
3762
3764 public:
3765 PT_show_open_tables(const POS &pos, char *opt_db, const LEX_STRING &wild,
3766 Item *where)
3768 }
3769
3770 Sql_cmd *make_cmd(THD *thd) override;
3771
3772 private:
3774};
3775
3776/// Parse tree node for SHOW PLUGINS statement
3777
3778class PT_show_plugins final : public PT_show_base {
3779 public:
3781
3782 Sql_cmd *make_cmd(THD *thd) override;
3783
3784 private:
3786};
3787
3788/// Parse tree node for SHOW PRIVILEGES statement
3789
3790class PT_show_privileges final : public PT_show_base {
3791 public:
3794
3795 Sql_cmd *make_cmd(THD *thd) override;
3796
3797 private:
3799};
3800
3801/// Parse tree node for SHOW PARSE_TREE statement
3802
3803class PT_show_parse_tree final : public PT_show_base {
3804 public:
3805 PT_show_parse_tree(const POS &pos, Parse_tree_root *parse_tree_stmt)
3807 m_parse_tree_stmt(parse_tree_stmt) {}
3808
3809 Sql_cmd *make_cmd(THD *thd) override;
3810
3811 private:
3814};
3815
3816/// Parse tree node for SHOW FUNCTION CODE statement.
3817
3819 public:
3820 PT_show_procedure_code(const POS &pos, const sp_name *procedure_name)
3821 : PT_show_routine_code(pos, SQLCOM_SHOW_PROC_CODE, procedure_name) {}
3822};
3823
3824/// Parse tree node for SHOW PROCESSLIST statement
3825
3826class PT_show_processlist final : public PT_show_base {
3827 public:
3830
3831 Sql_cmd *make_cmd(THD *thd) override;
3832
3833 private:
3835};
3836
3837/// Parse tree node for SHOW PROFILE statement
3838
3839class PT_show_profile final : public PT_show_base {
3840 public:
3841 PT_show_profile(const POS &pos, uint opt_profile_options = 0,
3842 my_thread_id opt_query_id = 0,
3843 PT_limit_clause *opt_limit_clause = nullptr)
3845 m_opt_profile_options(opt_profile_options),
3846 m_opt_query_id(opt_query_id),
3847 m_opt_limit_clause(opt_limit_clause) {}
3848
3849 Sql_cmd *make_cmd(THD *thd) override;
3850
3851 private:
3855
3857};
3858
3859/// Parse tree node for SHOW PROFILES statement
3860
3861class PT_show_profiles final : public PT_show_base {
3862 public:
3864
3865 Sql_cmd *make_cmd(THD *thd) override;
3866
3867 private:
3869};
3870
3871/// Parse tree node for SHOW RELAYLOG EVENTS statement
3872
3874 public:
3876 const LEX_STRING opt_log_file_name = {},
3877 PT_limit_clause *opt_limit_clause = nullptr,
3878 LEX_CSTRING opt_channel_name = {})
3880 m_opt_log_file_name(opt_log_file_name),
3881 m_opt_limit_clause(opt_limit_clause),
3882 m_opt_channel_name(opt_channel_name) {}
3883
3884 Sql_cmd *make_cmd(THD *thd) override;
3885
3886 private:
3890
3892};
3893
3894/// Parse tree node for SHOW REPLICAS statement
3895
3896class PT_show_replicas final : public PT_show_base {
3897 public:
3899
3900 Sql_cmd *make_cmd(THD *thd) override;
3901
3902 private:
3904};
3905
3906/// Parse tree node for SHOW REPLICA STATUS statement
3907
3909 public:
3910 PT_show_replica_status(const POS &pos, LEX_CSTRING opt_channel_name = {})
3912 m_opt_channel_name(opt_channel_name) {}
3913
3914 Sql_cmd *make_cmd(THD *thd) override;
3915
3916 private:
3918
3920};
3921
3922/// Parse tree node for SHOW STATUS statement
3923
3925 public:
3926 PT_show_status(const POS &pos, enum_var_type var_type, const LEX_STRING &wild,
3927 Item *where)
3929 m_var_type(var_type) {
3931 }
3932
3933 Sql_cmd *make_cmd(THD *thd) override;
3934
3935 private:
3937
3939};
3940
3941/// Parse tree node for SHOW STATUS FUNCTION statement
3942
3944 public:
3945 PT_show_status_func(const POS &pos, const LEX_STRING &wild, Item *where)
3947
3948 Sql_cmd *make_cmd(THD *thd) override;
3949
3950 private:
3952};
3953
3954/// Parse tree node for SHOW STATUS PROCEDURE statement
3955
3957 public:
3958 PT_show_status_proc(const POS &pos, const LEX_STRING &wild, Item *where)
3960
3961 Sql_cmd *make_cmd(THD *thd) override;
3962
3963 private:
3965};
3966
3967/// Parse tree node for SHOW TABLE STATUS statement
3968
3970 public:
3971 PT_show_table_status(const POS &pos, char *opt_db, const LEX_STRING &wild,
3972 Item *where)
3974 where) {}
3975
3976 Sql_cmd *make_cmd(THD *thd) override;
3977
3978 private:
3980};
3981
3982/// Parse tree node for SHOW TABLES statement
3983
3985 public:
3986 PT_show_tables(const POS &pos, Show_cmd_type show_cmd_type, char *opt_db,
3987 const LEX_STRING &wild, Item *where)
3989 m_show_cmd_type(show_cmd_type) {}
3990
3991 Sql_cmd *make_cmd(THD *thd) override;
3992
3993 private:
3995
3997};
3998
3999/// Parse tree node for SHOW TRIGGERS statement
4000
4002 public:
4003 PT_show_triggers(const POS &pos, bool full, char *opt_db,
4004 const LEX_STRING &wild, Item *where)
4006 m_full(full) {}
4007
4008 Sql_cmd *make_cmd(THD *thd) override;
4009
4010 private:
4012
4014};
4015
4016/// Parse tree node for SHOW VARIABLES statement
4017
4019 public:
4021 const LEX_STRING &wild, Item *where)
4023 m_var_type(var_type) {
4025 }
4026
4027 Sql_cmd *make_cmd(THD *thd) override;
4028
4029 private:
4031
4033};
4034
4035/// Parse tree node for SHOW WARNINGS statement
4036
4037class PT_show_warnings final : public PT_show_base {
4038 public:
4039 PT_show_warnings(const POS &pos, PT_limit_clause *opt_limit_clause = nullptr)
4041 m_opt_limit_clause(opt_limit_clause) {}
4042
4043 Sql_cmd *make_cmd(THD *thd) override;
4044
4045 private:
4047
4049};
4050
4053
4054 protected:
4055 explicit PT_alter_table_action(const POS &pos,
4057 : super(pos), flag(flag) {}
4058
4059 public:
4060 bool do_contextualize(Table_ddl_parse_context *pc) override;
4061
4062 protected:
4063 /**
4064 A routine used by the parser to decide whether we are specifying a full
4065 partitioning or if only partitions to add or to reorganize.
4066
4067 @retval true ALTER TABLE ADD/REORGANIZE PARTITION.
4068 @retval false Something else.
4069 */
4073 }
4074
4075 public:
4077};
4078
4081
4082 public:
4083 PT_alter_table_add_column(const POS &pos, const LEX_STRING &field_ident,
4084 PT_field_def_base *field_def,
4085 PT_table_constraint_def *opt_column_constraint,
4086 const char *opt_place)
4087 : super(pos, Alter_info::ALTER_ADD_COLUMN),
4088 m_column_def(POS(), field_ident, field_def, opt_column_constraint,
4089 opt_place) {}
4090
4093 }
4094
4095 private:
4096 PT_column_def m_column_def; // TODO: Position is not set.
4097};
4098
4101
4102 public:
4104 const POS &pos, const Mem_root_array<PT_table_element *> *columns)
4105 : super(pos, Alter_info::ALTER_ADD_COLUMN), m_columns(columns) {}
4106
4108 if (super::do_contextualize(pc)) return true;
4109
4110 for (auto *column : *m_columns)
4111 if (column->contextualize(pc)) return true;
4112
4113 return false;
4114 }
4115
4116 private:
4118};
4119
4122
4123 public:
4125 PT_table_constraint_def *constraint)
4126 : super(pos, Alter_info::ALTER_ADD_INDEX), m_constraint(constraint) {}
4127
4130 }
4131
4132 private:
4134};
4135
4138
4139 public:
4140 PT_alter_table_change_column(const POS &pos, const LEX_STRING &old_name,
4141 const LEX_STRING &new_name,
4142 PT_field_def_base *field_def,
4143 const char *opt_place)
4144 : super(pos, Alter_info::ALTER_CHANGE_COLUMN),
4145 m_old_name(old_name),
4146 m_new_name(new_name),
4147 m_field_def(field_def),
4148 m_opt_place(opt_place) {}
4149
4151 PT_field_def_base *field_def,
4152 const char *opt_place)
4153 : PT_alter_table_change_column(pos, name, name, field_def, opt_place) {}
4154
4155 bool do_contextualize(Table_ddl_parse_context *pc) override;
4156
4157 private:
4161 const char *m_opt_place;
4162};
4163
4166
4167 protected:
4169 Alter_info::Alter_info_flag alter_info_flag,
4170 const char *name)
4171 : super(pos, alter_info_flag), m_alter_drop(drop_type, name) {}
4172
4173 public:
4175 return (super::do_contextualize(pc) ||
4176 pc->alter_info->drop_list.push_back(&m_alter_drop));
4177 }
4178
4179 private:
4181};
4182
4184 public:
4185 explicit PT_alter_table_drop_column(const POS &pos, const char *name)
4186 : PT_alter_table_drop(pos, Alter_drop::COLUMN,
4187 Alter_info::ALTER_DROP_COLUMN, name) {}
4188};
4189
4191 public:
4192 explicit PT_alter_table_drop_foreign_key(const POS &pos, const char *name)
4194 Alter_info::DROP_FOREIGN_KEY, name) {}
4195};
4196
4198 public:
4199 explicit PT_alter_table_drop_key(const POS &pos, const char *name)
4200 : PT_alter_table_drop(pos, Alter_drop::KEY, Alter_info::ALTER_DROP_INDEX,
4201 name) {}
4202};
4203
4205 public:
4207 const char *name)
4208 : PT_alter_table_drop(pos, Alter_drop::CHECK_CONSTRAINT,
4209 Alter_info::DROP_CHECK_CONSTRAINT, name) {}
4210};
4211
4213 public:
4214 explicit PT_alter_table_drop_constraint(const POS &pos, const char *name)
4215 : PT_alter_table_drop(pos, Alter_drop::ANY_CONSTRAINT,
4216 Alter_info::DROP_ANY_CONSTRAINT, name) {}
4217};
4218
4221
4222 protected:
4224 const POS &pos, Alter_constraint_enforcement::Type alter_type,
4225 Alter_info::Alter_info_flag alter_info_flag, const char *name,
4226 bool is_enforced)
4227 : super(pos, alter_info_flag),
4228 m_constraint_enforcement(alter_type, name, is_enforced) {}
4229
4230 public:
4231 explicit PT_alter_table_enforce_constraint(const POS &pos, const char *name,
4232 bool is_enforced)
4233 : super(pos, is_enforced ? Alter_info::ENFORCE_ANY_CONSTRAINT
4234 : Alter_info::SUSPEND_ANY_CONSTRAINT),
4236 Alter_constraint_enforcement::Type::ANY_CONSTRAINT, name,
4237 is_enforced) {}
4238
4240 return (super::do_contextualize(pc) ||
4243 }
4244
4245 private:
4247};
4248
4251 public:
4253 const char *name,
4254 bool is_enforced)
4256 pos, Alter_constraint_enforcement::Type::CHECK_CONSTRAINT,
4257 is_enforced ? Alter_info::ENFORCE_CHECK_CONSTRAINT
4258 : Alter_info::SUSPEND_CHECK_CONSTRAINT,
4259 name, is_enforced) {}
4260};
4261
4264
4265 public:
4266 explicit PT_alter_table_enable_keys(const POS &pos, bool enable)
4267 : super(pos, Alter_info::ALTER_KEYS_ONOFF), m_enable(enable) {}
4268
4270 pc->alter_info->keys_onoff =
4272 return super::do_contextualize(pc);
4273 }
4274
4275 private:
4277};
4278
4281
4282 public:
4283 PT_alter_table_set_default(const POS &pos, const char *col_name,
4284 Item *opt_default_expr)
4285 : super(pos, Alter_info::ALTER_CHANGE_COLUMN_DEFAULT),
4286 m_name(col_name),
4287 m_expr(opt_default_expr) {}
4288
4289 bool do_contextualize(Table_ddl_parse_context *pc) override;
4290
4291 private:
4292 const char *m_name;
4294};
4295
4298
4299 public:
4300 PT_alter_table_column_visibility(const POS &pos, const char *col_name,
4301 bool is_visible)
4302 : super(pos, Alter_info::ALTER_COLUMN_VISIBILITY),
4303 m_alter_column(col_name, is_visible) {}
4304
4306 return (super::do_contextualize(pc) ||
4307 pc->alter_info->alter_list.push_back(&m_alter_column));
4308 }
4309
4310 private:
4312};
4313
4316
4317 public:
4318 PT_alter_table_index_visible(const POS &pos, const char *name, bool visible)
4319 : super(pos, Alter_info::ALTER_INDEX_VISIBILITY),
4320 m_alter_index_visibility(name, visible) {}
4321
4323 return (super::do_contextualize(pc) ||
4326 }
4327
4328 private:
4330};
4331
4334
4335 public:
4336 explicit PT_alter_table_rename(const POS &pos, const Table_ident *ident)
4337 : super(pos, Alter_info::ALTER_RENAME), m_ident(ident) {}
4338
4339 bool do_contextualize(Table_ddl_parse_context *pc) override;
4340
4341 bool is_rename_table() const override { return true; }
4342
4343 private:
4344 const Table_ident *const m_ident;
4345};
4346
4349
4350 public:
4351 PT_alter_table_rename_key(const POS &pos, const char *from, const char *to)
4352 : super(pos, Alter_info::ALTER_RENAME_INDEX), m_rename_key(from, to) {}
4353
4355 return super::do_contextualize(pc) ||
4357 }
4358
4359 private:
4361};
4362
4365
4366 public:
4367 PT_alter_table_rename_column(const POS &pos, const char *from, const char *to)
4368 : super(pos, Alter_info::ALTER_CHANGE_COLUMN),
4369 m_rename_column(from, to) {}
4370
4372 return super::do_contextualize(pc) ||
4373 pc->alter_info->alter_list.push_back(&m_rename_column);
4374 }
4375
4376 private:
4378};
4379
4382
4383 public:
4385 const CHARSET_INFO *opt_collation)
4386 : super(pos, Alter_info::ALTER_OPTIONS),
4388 m_collation(opt_collation) {}
4389
4390 bool do_contextualize(Table_ddl_parse_context *pc) override;
4391
4392 private:
4395};
4396
4399
4400 public:
4401 explicit PT_alter_table_force(const POS &pos)
4402 : super(pos, Alter_info::ALTER_RECREATE) {}
4403};
4404
4407
4408 public:
4409 explicit PT_alter_table_order(const POS &pos, PT_order_list *order)
4410 : super(pos, Alter_info::ALTER_ORDER), m_order(order) {}
4411
4412 bool do_contextualize(Table_ddl_parse_context *pc) override;
4413
4414 private:
4416};
4417
4420
4421 public:
4422 explicit PT_alter_table_partition_by(const POS &pos, PT_partition *partition)
4423 : super(pos, Alter_info::ALTER_PARTITION), m_partition(partition) {}
4424
4425 bool do_contextualize(Table_ddl_parse_context *pc) override;
4426
4427 private:
4429};
4430
4433
4434 public:
4436 : super(pos, Alter_info::ALTER_REMOVE_PARTITIONING) {}
4437};
4438
4441
4442 friend class PT_alter_table_standalone_stmt; // to access make_cmd()
4443
4444 protected:
4446 Alter_info::Alter_info_flag alter_info_flag)
4447 : super(pos, alter_info_flag) {}
4448
4449 private:
4451};
4452
4453/**
4454 Node for the @SQL{ALTER TABLE ADD PARTITION} statement
4455
4456 @ingroup ptn_alter_table
4457*/
4460
4461 public:
4462 explicit PT_alter_table_add_partition(const POS &pos, bool no_write_to_binlog)
4463 : super(pos, Alter_info::ALTER_ADD_PARTITION),
4464 m_no_write_to_binlog(no_write_to_binlog) {}
4465
4466 bool do_contextualize(Table_ddl_parse_context *pc) override;
4467
4469 return new (pc->mem_root) Sql_cmd_alter_table(pc->alter_info);
4470 }
4471
4472 protected:
4474
4475 private:
4477};
4478
4479/**
4480 Node for the @SQL{ALTER TABLE ADD PARTITION (@<partition list@>)} statement
4481
4482 @ingroup ptn_alter_table
4483*/
4487
4488 public:
4490 const POS &pos, bool no_write_to_binlog,
4492 : super(pos, no_write_to_binlog), m_def_list(def_list) {}
4493
4494 bool do_contextualize(Table_ddl_parse_context *pc) override;
4495
4496 private:
4498};
4499
4500/**
4501 Node for the @SQL{ALTER TABLE ADD PARTITION PARTITIONS (@<n>@)} statement
4502
4503 @ingroup ptn_alter_table
4504*/
4508
4509 public:
4510 PT_alter_table_add_partition_num(const POS &pos, bool no_write_to_binlog,
4511 uint num_parts)
4512 : super(pos, no_write_to_binlog) {
4513 m_part_info.num_parts = num_parts;
4514 }
4515};
4516
4520
4521 public:
4523 const List<String> &partitions)
4524 : super(pos, Alter_info::ALTER_DROP_PARTITION),
4525 m_partitions(partitions) {}
4526
4527 bool do_contextualize(Table_ddl_parse_context *pc) override;
4528
4530 return new (pc->mem_root) Sql_cmd_alter_table(pc->alter_info);
4531 }
4532
4533 private:
4535};
4536
4540
4541 public:
4543 const POS &pos, Alter_info::Alter_info_flag alter_info_flag,
4544 const List<String> *opt_partition_list)
4545 : super(pos, alter_info_flag), m_opt_partition_list(opt_partition_list) {}
4546
4548 assert(pc->alter_info->partition_names.is_empty());
4549 if (m_opt_partition_list == nullptr)
4551 else
4553 return super::do_contextualize(pc);
4554 }
4555
4556 private:
4558};
4559
4563
4564 public:
4565 PT_alter_table_rebuild_partition(const POS &pos, bool no_write_to_binlog,
4566 const List<String> *opt_partition_list)
4567 : super(pos, Alter_info::ALTER_REBUILD_PARTITION, opt_partition_list),
4568 m_no_write_to_binlog(no_write_to_binlog) {}
4569
4570 bool do_contextualize(Table_ddl_parse_context *pc) override;
4571
4573 return new (pc->mem_root) Sql_cmd_alter_table(pc->alter_info);
4574 }
4575
4576 private:
4578};
4579
4583
4584 public:
4585 PT_alter_table_optimize_partition(const POS &pos, bool no_write_to_binlog,
4586 const List<String> *opt_partition_list)
4587 : super(pos, Alter_info::ALTER_ADMIN_PARTITION, opt_partition_list),
4588 m_no_write_to_binlog(no_write_to_binlog) {}
4589
4590 bool do_contextualize(Table_ddl_parse_context *pc) override;
4591
4593 return new (pc->mem_root)
4595 }
4596
4597 private:
4599};
4600
4604
4605 public:
4606 PT_alter_table_analyze_partition(const POS &pos, bool no_write_to_binlog,
4607 const List<String> *opt_partition_list)
4608 : super(pos, Alter_info::ALTER_ADMIN_PARTITION, opt_partition_list),
4609 m_no_write_to_binlog(no_write_to_binlog) {}
4610
4611 bool do_contextualize(Table_ddl_parse_context *pc) override;
4613 return new (pc->mem_root)
4615 }
4616
4617 private:
4619};
4620
4624
4625 public:
4627 const List<String> *opt_partition_list,
4628 uint flags, uint sql_flags)
4629 : super(pos, Alter_info::ALTER_ADMIN_PARTITION, opt_partition_list),
4630 m_flags(flags),
4631 m_sql_flags(sql_flags) {}
4632
4633 bool do_contextualize(Table_ddl_parse_context *pc) override;
4634
4636 return new (pc->mem_root)
4638 }
4639
4640 private:
4643};
4644
4648
4649 public:
4650 PT_alter_table_repair_partition(const POS &pos, bool no_write_to_binlog,
4651 const List<String> *opt_partition_list,
4652 uint flags, uint sql_flags)
4653 : super(pos, Alter_info::ALTER_ADMIN_PARTITION, opt_partition_list),
4654 m_no_write_to_binlog(no_write_to_binlog),
4655 m_flags(flags),
4656 m_sql_flags(sql_flags) {}
4657
4658 bool do_contextualize(Table_ddl_parse_context *pc) override;
4659
4661 return new (pc->mem_root)
4663 }
4664
4665 private:
4669};
4670
4674
4675 public:
4676 PT_alter_table_coalesce_partition(const POS &pos, bool no_write_to_binlog,
4677 uint num_parts)
4678 : super(pos, Alter_info::ALTER_COALESCE_PARTITION),
4679 m_no_write_to_binlog(no_write_to_binlog),
4680 m_num_parts(num_parts) {}
4681
4682 bool do_contextualize(Table_ddl_parse_context *pc) override;
4683
4685 return new (pc->mem_root) Sql_cmd_alter_table(pc->alter_info);
4686 }
4687
4688 private:
4690 const uint m_num_parts;
4691};
4692
4696
4697 public:
4699 const POS &pos, const List<String> *opt_partition_list)
4700 : super(pos,
4701 static_cast<Alter_info::Alter_info_flag>(
4702 Alter_info::ALTER_ADMIN_PARTITION |
4703 Alter_info::ALTER_TRUNCATE_PARTITION),
4704 opt_partition_list) {}
4705
4706 bool do_contextualize(Table_ddl_parse_context *pc) override;
4707
4709 return new (pc->mem_root)
4711 }
4712};
4713
4717
4718 public:
4720 bool no_write_to_binlog)
4721 : super(pos, Alter_info::ALTER_TABLE_REORG),
4722 m_no_write_to_binlog(no_write_to_binlog) {}
4723
4724 bool do_contextualize(Table_ddl_parse_context *pc) override;
4725
4727 return new (pc->mem_root) Sql_cmd_alter_table(pc->alter_info);
4728 }
4729
4730 private:
4733};
4734
4738
4739 public:
4741 const POS &pos, bool no_write_to_binlog,
4742 const List<String> &partition_names,
4744 : super(pos, Alter_info::ALTER_REORGANIZE_PARTITION),
4745 m_no_write_to_binlog(no_write_to_binlog),
4746 m_partition_names(partition_names),
4747 m_into(into) {}
4748
4749 bool do_contextualize(Table_ddl_parse_context *pc) override;
4750
4752 return new (pc->mem_root) Sql_cmd_alter_table(pc->alter_info);
4753 }
4754
4755 private:
4760};
4761
4765
4766 public:
4768 const LEX_STRING &partition_name,
4771 : super(pos, Alter_info::ALTER_EXCHANGE_PARTITION),
4772 m_partition_name(partition_name),
4774 m_validation(validation) {}
4775
4776 bool do_contextualize(Table_ddl_parse_context *pc) override;
4777
4779 return new (pc->mem_root)
4781 }
4782
4783 private:
4787};
4788
4792
4794
4795 public:
4797 const POS &pos, const List<String> *opt_use_partition = nullptr)
4798 : super(pos, Alter_info::ALTER_SECONDARY_LOAD),
4800
4802 if (opt_use_partition != nullptr)
4804
4806 }
4807};
4808
4812
4814
4815 public:
4817 const POS &pos, const List<String> *opt_use_partition = nullptr)
4818 : super(pos, Alter_info::ALTER_SECONDARY_UNLOAD),
4820
4822 if (opt_use_partition != nullptr)
4824
4826 }
4827};
4828
4832
4833 public:
4835 const POS &pos, const List<String> *opt_partition_list)
4836 : super(pos, Alter_info::ALTER_DISCARD_TABLESPACE, opt_partition_list) {}
4837
4840 }
4841};
4842
4846
4847 public:
4849 const POS &pos, const List<String> *opt_partition_list)
4850 : super(pos, Alter_info::ALTER_IMPORT_TABLESPACE, opt_partition_list) {}
4851
4854 }
4855};
4856
4860
4861 public:
4863 : super(pos, Alter_info::ALTER_DISCARD_TABLESPACE) {}
4864
4867 }
4868};
4869
4873
4874 public:
4876 : super(pos, Alter_info::ALTER_IMPORT_TABLESPACE) {}
4877
4880 }
4881};
4882
4884 public:
4893 m_opt_actions(opt_actions),
4894 m_algo(algo),
4895 m_lock(lock),
4896 m_validation(validation) {}
4897
4898 Sql_cmd *make_cmd(THD *thd) override;
4899
4900 private:
4906
4908};
4909
4911 public:
4921 m_algo(algo),
4922 m_lock(lock),
4923 m_validation(validation) {}
4924
4925 Sql_cmd *make_cmd(THD *thd) override;
4926
4927 private:
4933
4935};
4936
4938 public:
4940 bool no_write_to_binlog,
4942 decltype(HA_CHECK_OPT::flags) flags,
4943 decltype(HA_CHECK_OPT::sql_flags) sql_flags)
4945 m_no_write_to_binlog(no_write_to_binlog),
4946 m_table_list(table_list),
4947 m_flags(flags),
4948 m_sql_flags(sql_flags) {}
4949
4950 Sql_cmd *make_cmd(THD *thd) override;
4951
4952 private:
4957};
4958
4960 public:
4962 bool no_write_to_binlog,
4965 int num_buckets, List<String> *columns, LEX_STRING data,
4966 bool auto_update)
4968 m_no_write_to_binlog(no_write_to_binlog),
4969 m_table_list(table_list),
4971 m_num_buckets(num_buckets),
4972 m_columns(columns),
4973 m_data{data},
4974 m_auto_update(auto_update) {}
4975
4976 Sql_cmd *make_cmd(THD *thd) override;
4977
4978 private:
4982 const int m_num_buckets;
4985 const bool m_auto_update;
4986};
4987
4989 public:
4992 decltype(HA_CHECK_OPT::flags) flags,
4993 decltype(HA_CHECK_OPT::sql_flags) sql_flags)
4995 m_table_list(table_list),
4996 m_flags(flags),
4997 m_sql_flags(sql_flags) {}
4998
4999 Sql_cmd *make_cmd(THD *thd) override;
5000
5001 private:
5005};
5006
5008 public:
5010 bool no_write_to_binlog,
5013 m_no_write_to_binlog(no_write_to_binlog),
5014 m_table_list(table_list) {}
5015
5016 Sql_cmd *make_cmd(THD *thd) override;
5017
5020};
5021
5023 public:
5024 PT_drop_index_stmt(const POS &pos, MEM_ROOT *mem_root, const char *index_name,
5029 m_index_name(index_name),
5030 m_table(table),
5031 m_algo(algo),
5032 m_lock(lock),
5034
5035 Sql_cmd *make_cmd(THD *thd) override;
5036
5037 private:
5038 const char *m_index_name;
5042
5044};
5045
5047 public:
5049 : Parse_tree_root(pos), m_table(table) {}
5050
5051 Sql_cmd *make_cmd(THD *thd) override;
5052
5053 private:
5055
5057};
5058
5061
5062 public:
5064 List<Index_hint> *index_hints)
5065 : super(pos), m_table(table), m_index_hints(index_hints) {}
5066
5067 bool do_contextualize(Table_ddl_parse_context *pc) override;
5068
5069 private:
5072};
5073
5074class PT_adm_partition final : public Table_ddl_node {
5076
5077 public:
5078 explicit PT_adm_partition(const POS &pos, List<String> *opt_partitions)
5079 : super(pos), m_opt_partitions(opt_partitions) {}
5080
5081 bool do_contextualize(Table_ddl_parse_context *pc) override;
5082
5083 private:
5085};
5086
5088 public:
5091 LEX_CSTRING key_cache_name)
5093 m_tbl_index_lists(tbl_index_lists),
5094 m_key_cache_name(key_cache_name) {}
5095
5096 Sql_cmd *make_cmd(THD *thd) override;
5097
5098 private:
5101};
5102
5104 public:
5107 PT_adm_partition *partitions,
5108 List<Index_hint> *opt_key_usage_list,
5109 LEX_CSTRING key_cache_name)
5111 m_table(table),
5112 m_partitions(partitions),
5113 m_opt_key_usage_list(opt_key_usage_list),
5114 m_key_cache_name(key_cache_name) {}
5115
5116 Sql_cmd *make_cmd(THD *thd) override;
5117
5118 private:
5123};
5124
5125class PT_preload_keys final : public Table_ddl_node {
5127
5128 public:
5130 List<Index_hint> *opt_cache_key_list, bool ignore_leaves)
5131 : super(pos),
5132 m_table(table),
5133 m_opt_cache_key_list(opt_cache_key_list),
5134 m_ignore_leaves(ignore_leaves) {}
5135
5136 bool do_contextualize(Table_ddl_parse_context *pc) override;
5137
5138 private:
5142};
5143
5145 public:
5148 PT_adm_partition *partitions,
5149 List<Index_hint> *opt_cache_key_list,
5150 bool ignore_leaves)
5152 m_table(table),
5153 m_partitions(partitions),
5154 m_opt_cache_key_list(opt_cache_key_list),
5155 m_ignore_leaves(ignore_leaves) {}
5156
5157 Sql_cmd *make_cmd(THD *thd) override;
5158
5159 private:
5164};
5165
5167 public:
5170 : PT_table_ddl_stmt_base(pos, mem_root), m_preload_list(preload_list) {}
5171
5172 Sql_cmd *make_cmd(THD *thd) override;
5173
5174 private:
5176};
5177
5180
5181 public:
5184 bool do_contextualize(Parse_context *pc) override;
5185 Json_table_column *get_column() override { return m_column.get(); }
5186
5187 private:
5189 const char *m_name;
5190};
5191
5194
5195 public:
5200
5201 bool do_contextualize(Parse_context *pc) override;
5202
5203 Json_table_column *get_column() override { return m_column.get(); }
5204
5205 private:
5207 const char *m_name;
5210};
5211
5213 : public PT_json_table_column {
5215
5216 public:
5218 const POS &pos, Item *path,
5220 : super(pos), m_path(path), m_nested_columns(nested_cols) {}
5221
5222 bool do_contextualize(Parse_context *pc) override;
5223
5224 Json_table_column *get_column() override { return m_column; }
5225
5226 private:
5230};
5231
5233 public Tablespace_options {
5234 THD *const thd;
5236
5238 bool show_parse_tree = false);
5239};
5240
5243
5244template <typename Option_type, Option_type Tablespace_options::*Option>
5246 : public PT_alter_tablespace_option_base /* purecov: inspected */
5247{
5249
5250 public:
5251 explicit PT_alter_tablespace_option(const POS &pos, Option_type value)
5252 : super(pos), m_value(value) {}
5253
5255 pc->*Option = m_value;
5256 return super::do_contextualize(pc);
5257 }
5258
5259 private:
5260 const Option_type m_value;
5261};
5262
5267
5271
5275
5279
5284
5289
5294
5298
5300 : public PT_alter_tablespace_option_base /* purecov: inspected */
5301{
5304
5305 public:
5307 option_type nodegroup_id)
5308 : super(pos), m_nodegroup_id(nodegroup_id) {}
5309
5311
5312 private:
5314};
5315
5317 : public PT_alter_tablespace_option_base /* purecov: inspected */
5318{
5321
5322 public:
5325 : super(pos), m_comment(comment) {}
5326
5329 return true; /* purecov: inspected */ // OOM
5330
5331 if (pc->ts_comment.str) {
5332 my_error(ER_FILEGROUP_OPTION_ONLY_ONCE, MYF(0), "COMMENT");
5333 return true;
5334 }
5335 pc->ts_comment = m_comment;
5336 return false;
5337 }
5338
5339 private:
5341};
5342
5344 : public PT_alter_tablespace_option_base /* purecov: inspected */
5345{
5348
5349 public:
5351 option_type engine_name)
5352 : super(pos), m_engine_name(engine_name) {}
5353
5356 return true; /* purecov: inspected */ // OOM
5357
5358 if (pc->engine_name.str) {
5359 my_error(ER_FILEGROUP_OPTION_ONLY_ONCE, MYF(0), "STORAGE ENGINE");
5360 return true;
5361 }
5363 return false;
5364 }
5365
5366 private:
5368};
5369
5371 : public PT_alter_tablespace_option_base /* purecov: inspected */
5372{
5375
5376 public:
5378 const POS &pos, option_type file_block_size)
5379 : super(pos), m_file_block_size(file_block_size) {}
5380
5383 return true; /* purecov: inspected */ // OOM
5384
5385 if (pc->file_block_size != 0) {
5386 my_error(ER_FILEGROUP_OPTION_ONLY_ONCE, MYF(0), "FILE_BLOCK_SIZE");
5387 return true;
5388 }
5390 return false;
5391 }
5392
5393 private:
5395};
5396
5397/**
5398 Parse tree node for CREATE RESOURCE GROUP statement.
5399*/
5400
5403 const bool has_priority;
5404
5405 public:
5407 const POS &pos, const LEX_CSTRING &name, const resourcegroups::Type type,
5409 const Value_or_default<int> &opt_priority, bool enabled)
5410 : Parse_tree_root(pos),
5411 sql_cmd(name, type, cpu_list,
5412 opt_priority.is_default ? 0 : opt_priority.value, enabled),
5413 has_priority(!opt_priority.is_default) {}
5414
5415 Sql_cmd *make_cmd(THD *thd) override;
5416};
5417
5418/**
5419 Parse tree node for ALTER RESOURCE GROUP statement.
5420*/
5421
5424
5425 public:
5428 const Value_or_default<int> &opt_priority,
5429 const Value_or_default<bool> &enable, bool force)
5430 : Parse_tree_root(pos),
5431 sql_cmd(name, cpu_list,
5432 opt_priority.is_default ? 0 : opt_priority.value,
5433 enable.is_default ? false : enable.value, force,
5434 !enable.is_default) {}
5435
5436 Sql_cmd *make_cmd(THD *thd) override;
5437};
5438
5439/**
5440 Parse tree node for DROP RESOURCE GROUP statement.
5441*/
5442
5445
5446 public:
5447 PT_drop_resource_group(const POS &pos, const LEX_CSTRING &resource_group_name,
5448 bool force)
5449 : Parse_tree_root(pos), sql_cmd(resource_group_name, force) {}
5450
5451 Sql_cmd *make_cmd(THD *thd) override;
5452};
5453
5454/**
5455 Parse tree node for SET RESOURCE GROUP statement.
5456*/
5457
5460
5461 public:
5463 Mem_root_array<ulonglong> *thread_id_list)
5464 : Parse_tree_root(pos), sql_cmd(name, thread_id_list) {}
5465
5466 Sql_cmd *make_cmd(THD *thd) override;
5467};
5468
5470 public:
5472 : Parse_tree_root(pos), m_cmd(thread_id) {}
5473
5474 Sql_cmd *make_cmd(THD *thd) override;
5475
5476 private:
5478};
5479
5481 public:
5482 PT_explain(const POS &pos, Explain_format_type format, bool is_analyze,
5483 bool is_explicit_format, Parse_tree_root *explainable_stmt,
5484 std::optional<std::string_view> explain_into_variable_name,
5485 LEX_CSTRING schema_name_for_explain)
5486 : Parse_tree_root(pos),
5487 m_format(format),
5488 m_analyze(is_analyze),
5489 m_explicit_format(is_explicit_format),
5490 m_explainable_stmt(explainable_stmt),
5491 m_explain_into_variable_name(explain_into_variable_name),
5492 m_schema_name_for_explain(schema_name_for_explain) {}
5493
5494 Sql_cmd *make_cmd(THD *thd) override;
5495
5496 private:
5498 const bool m_analyze;
5501 std::optional<std::string_view> m_explain_into_variable_name;
5503};
5504
5505class PT_load_table final : public Parse_tree_root {
5506 public:
5507 PT_load_table(const POS &pos, enum_filetype filetype, thr_lock_type lock_type,
5508 bool is_local_file, enum_source_type source_type,
5509 const LEX_STRING filename, ulong file_count, bool in_key_order,
5510 On_duplicate on_duplicate, Table_ident *table,
5511 List<String> *opt_partitions, const CHARSET_INFO *opt_charset,
5512 LEX_CSTRING compression_algorithm,
5513 String *opt_xml_rows_identified_by,
5514 const Field_separators &opt_field_separators,
5515 const Line_separators &opt_line_separators,
5516 ulong opt_ignore_lines, PT_item_list *opt_fields_or_vars,
5517 PT_item_list *opt_set_fields, PT_item_list *opt_set_exprs,
5518 List<String> *opt_set_expr_strings, ulong parallel,
5519 ulonglong memory_size, bool is_bulk_operation)
5520 : Parse_tree_root(pos),
5521 m_cmd(filetype, is_local_file, source_type, filename, file_count,
5522 in_key_order, on_duplicate, table, opt_partitions, opt_charset,
5523 compression_algorithm, opt_xml_rows_identified_by,
5524 opt_field_separators, opt_line_separators, opt_ignore_lines,
5525 opt_fields_or_vars ? &opt_fields_or_vars->value : nullptr,
5526 opt_set_fields ? &opt_set_fields->value : nullptr,
5527 opt_set_exprs ? &opt_set_exprs->value : nullptr,
5528 opt_set_expr_strings, parallel, memory_size, is_bulk_operation),
5529 m_lock_type(lock_type) {
5530 assert((opt_set_fields == nullptr) ^ (opt_set_exprs != nullptr));
5531 assert(opt_set_fields == nullptr ||
5532 opt_set_fields->value.size() == opt_set_exprs->value.size());
5533 }
5534
5535 Sql_cmd *make_cmd(THD *thd) override;
5536
5537 private:
5539
5541};
5542
5543/**
5544 Top-level node for the SHUTDOWN statement
5545
5546 @ingroup ptn_stmt
5547*/
5548
5550 public:
5551 Sql_cmd *make_cmd(THD *thd) override;
5552
5553 private:
5555};
5556
5558 private:
5561
5562 public:
5563 PT_install_component(const POS &pos, THD *thd,
5566 Sql_cmd *make_cmd(THD *thd) override;
5567};
5568
5570 LEX_CSTRING);
5571
5574 LEX_CSTRING);
5575
5578 LEX_CSTRING);
5579
5582 LEX_CSTRING);
5583
5584/**
5585 Helper function to imitate \c dynamic_cast for \c PT_set_operation hierarchy.
5586
5587 Template parameter @p To is the destination type (@c PT_union, \c PT_except or
5588 \c PT_intersect). For \c PT_intersect we return nullptr if ALL due to impl.
5589 restriction: we cannot merge INTERSECT ALL.
5590
5591 @param from source item
5592 @param is_distinct true if distinct
5593 @return typecast item to the type To or NULL
5594*/
5595template <class To, PT_set_operation::Setop_type Tag>
5596To *setop_cast(PT_query_expression_body *from, bool is_distinct) {
5597 return (from->type() == Tag &&
5598 down_cast<PT_set_operation *>(from)->is_distinct() == is_distinct &&
5599 (Tag != PT_query_expression_body::INTERSECT || is_distinct))
5600 ? static_cast<To *>(from)
5601 : nullptr;
5602}
5603
5604/**
5605 Flatten set operators at parse time
5606
5607 This function flattens UNION ALL/DISTINCT, EXCEPT All/DISTINCT
5608 and INTERSECT DISTINCT (not ALL due to implementation restrictions) operators
5609 at parse time if applicable, otherwise it creates
5610 new \c PT_<setop> nodes respectively of the two input operands.
5611
5612 Template parameter @p Class is @c PT_union or @c PT_intersect
5613 Template parameter @p Tag is @c PT_query_specification::UNION or
5614 @c ::INTERSECT
5615
5616 @param mem_root MEM_ROOT
5617 @param pos parse location
5618 @param left left argument of the operator
5619 @param is_distinct true if DISTINCT
5620 @param right right argument of the operator
5621 @param is_right_in_parentheses
5622 true if right hand size is parenthesized
5623 @return resulting parse tree Item
5624*/
5625template <class Class, PT_set_operation::Setop_type Tag>
5628 bool is_distinct,
5630 bool is_right_in_parentheses) {
5631 if (left == nullptr || right == nullptr) return nullptr;
5632 Class *left_setop = setop_cast<Class, Tag>(left, is_distinct);
5633 Class *right_setop [[maybe_unused]] =
5634 setop_cast<Class, Tag>(right, is_distinct);
5635 assert(right_setop == nullptr); // doesn't happen
5636 if (left_setop != nullptr) {
5637 // X1 op X2 op Y ==> op (X1, X2, Y)
5638 left_setop->m_list.push_back(right);
5639 left_setop->set_is_rhs_in_parentheses(is_right_in_parentheses);
5640 return left_setop;
5641 } else {
5642 /* X op Y */
5643 return new (mem_root)
5644 Class(pos, left, is_distinct, right, is_right_in_parentheses);
5645 }
5646}
5647
5648#endif /* PARSE_TREE_NODES_INCLUDED */
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
bool check_stack_overrun(const THD *thd, long margin, unsigned char *buf)
Check stack for a overrun.
Definition: check_stack.cc:110
Class representing SET DEFAULT, DROP DEFAULT, RENAME COLUMN, SET VISIBLE and SET INVISIBLE clause in ...
Definition: sql_alter.h:82
Class representing ALTER CHECK and ALTER CONSTRAINT clauses in ALTER TABLE statement.
Definition: sql_alter.h:184
Type
Definition: sql_alter.h:186
Class representing DROP COLUMN, DROP KEY, DROP FOREIGN KEY, DROP CHECK CONSTRAINT and DROP CONSTRAINT...
Definition: sql_alter.h:65
drop_type
Definition: sql_alter.h:67
An ALTER INDEX operation that changes the visibility of an index.
Definition: sql_alter.h:148
Data describing the table being created by CREATE TABLE or altered by ALTER TABLE.
Definition: sql_alter.h:205
enum_alter_table_algorithm
The different values of the ALGORITHM clause.
Definition: sql_alter.h:355
enum_alter_table_lock
The different values of the LOCK clause.
Definition: sql_alter.h:373
Mem_root_array< const Alter_drop * > drop_list
Columns, keys and constraints to be dropped.
Definition: sql_alter.h:405
Mem_root_array< const Alter_constraint_enforcement * > alter_constraint_enforcement_list
List of check constraints whose enforcement state is changed.
Definition: sql_alter.h:419
List< String > partition_names
Definition: sql_alter.h:433
enum_with_validation
Status of validation clause in ALTER TABLE statement.
Definition: sql_alter.h:391
@ ENABLE
Definition: sql_alter.h:349
@ DISABLE
Definition: sql_alter.h:349
Mem_root_array< const Alter_column * > alter_list
Definition: sql_alter.h:407
enum_enable_or_disable keys_onoff
Definition: sql_alter.h:431
ulonglong flags
Definition: sql_alter.h:429
Mem_root_array< const Alter_rename_key * > alter_rename_key_list
Definition: sql_alter.h:412
Alter_info_flag
Definition: sql_alter.h:216
@ ALTER_ADD_PARTITION
Set for ADD PARTITION.
Definition: sql_alter.h:255
@ ALTER_REORGANIZE_PARTITION
Set for REORGANIZE PARTITION ... INTO.
Definition: sql_alter.h:264
@ ALTER_ALL_PARTITION
Set for partitioning operations specifying ALL keyword.
Definition: sql_alter.h:280
@ ALTER_OPTIONS
Set for table_options.
Definition: sql_alter.h:241
Mem_root_array< const Alter_index_visibility * > alter_index_visibility_list
Indexes whose visibilities are to be changed.
Definition: sql_alter.h:415
Class which instances represent RENAME INDEX clauses in ALTER TABLE statement.
Definition: sql_alter.h:170
After parsing, a Common Table Expression is accessed through a Table_ref.
Definition: table.h:4432
Definition: key.h:43
Definition: item.h:6858
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
Represents a JSON container value of type "object" (ECMA), type J_OBJECT here.
Definition: json_dom.h:369
bool add_alias(const std::string &key, Json_dom *value)
Insert the value into the object.
Definition: json_dom.h:411
Column description for JSON_TABLE function.
Definition: table_function.h:236
Definition: key_spec.h:67
bool is_algorithm_explicit
A flag which indicates that index algorithm was explicitly specified by user.
Definition: key_spec.h:74
enum ha_key_alg algorithm
Definition: key_spec.h:69
Definition: key.h:113
Definition: sql_list.h:467
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:61
size_t size() const
Definition: mem_root_array.h:407
void init_empty_const()
Initialize empty array that we aren't going to grow.
Definition: mem_root_array.h:84
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:426
bool deferred_hints_flag
Definition: opt_hints.h:356
PT_hint_list * deferred_hints
Definition: opt_hints.h:355
Definition: parse_tree_nodes.h:5074
List< String > * m_opt_partitions
Definition: parse_tree_nodes.h:5084
Table_ddl_node super
Definition: parse_tree_nodes.h:5075
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:3413
PT_adm_partition(const POS &pos, List< String > *opt_partitions)
Definition: parse_tree_nodes.h:5078
Top-level node for the ALTER INSTANCE statement.
Definition: parse_tree_nodes.h:2234
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4616
PT_alter_instance(const POS &pos, enum alter_instance_action_enum alter_instance_action, const LEX_CSTRING &channel)
Definition: parse_tree_nodes.h:2238
Sql_cmd_alter_instance sql_cmd
Definition: parse_tree_nodes.h:2235
Parse tree node for ALTER RESOURCE GROUP statement.
Definition: parse_tree_nodes.h:5422
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4923
PT_alter_resource_group(const POS &pos, const LEX_CSTRING &name, const Mem_root_array< resourcegroups::Range > *cpu_list, const Value_or_default< int > &opt_priority, const Value_or_default< bool > &enable, bool force)
Definition: parse_tree_nodes.h:5426
resourcegroups::Sql_cmd_alter_resource_group sql_cmd
Definition: parse_tree_nodes.h:5423
Definition: parse_tree_nodes.h:4051
PT_ddl_table_option super
Definition: parse_tree_nodes.h:4052
bool is_add_or_reorganize_partition() const
A routine used by the parser to decide whether we are specifying a full partitioning or if only parti...
Definition: parse_tree_nodes.h:4070
const Alter_info::Alter_info_flag flag
Definition: parse_tree_nodes.h:4076
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4737
PT_alter_table_action(const POS &pos, Alter_info::Alter_info_flag flag)
Definition: parse_tree_nodes.h:4055
Definition: parse_tree_nodes.h:4079
PT_alter_table_action super
Definition: parse_tree_nodes.h:4080
PT_column_def m_column_def
Definition: parse_tree_nodes.h:4096
PT_alter_table_add_column(const POS &pos, const LEX_STRING &field_ident, PT_field_def_base *field_def, PT_table_constraint_def *opt_column_constraint, const char *opt_place)
Definition: parse_tree_nodes.h:4083
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4091
Definition: parse_tree_nodes.h:4099
const Mem_root_array< PT_table_element * > * m_columns
Definition: parse_tree_nodes.h:4117
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4107
PT_alter_table_action super
Definition: parse_tree_nodes.h:4100
PT_alter_table_add_columns(const POS &pos, const Mem_root_array< PT_table_element * > *columns)
Definition: parse_tree_nodes.h:4103
Definition: parse_tree_nodes.h:4120
PT_alter_table_action super
Definition: parse_tree_nodes.h:4121
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4128
PT_table_constraint_def * m_constraint
Definition: parse_tree_nodes.h:4133
PT_alter_table_add_constraint(const POS &pos, PT_table_constraint_def *constraint)
Definition: parse_tree_nodes.h:4124
Node for the ALTER TABLE ADD PARTITION (<partition list>) statement.
Definition: parse_tree_nodes.h:4485
PT_alter_table_add_partition super
Definition: parse_tree_nodes.h:4486
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:3152
const Mem_root_array< PT_part_definition * > * m_def_list
Definition: parse_tree_nodes.h:4497
PT_alter_table_add_partition_def_list(const POS &pos, bool no_write_to_binlog, const Mem_root_array< PT_part_definition * > *def_list)
Definition: parse_tree_nodes.h:4489
Node for the ALTER TABLE ADD PARTITION PARTITIONS (<n>@) statement.
Definition: parse_tree_nodes.h:4506
PT_alter_table_add_partition_num(const POS &pos, bool no_write_to_binlog, uint num_parts)
Definition: parse_tree_nodes.h:4510
PT_alter_table_add_partition super
Definition: parse_tree_nodes.h:4507
Node for the ALTER TABLE ADD PARTITION statement.
Definition: parse_tree_nodes.h:4458
PT_alter_table_add_partition(const POS &pos, bool no_write_to_binlog)
Definition: parse_tree_nodes.h:4462
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4476
partition_info m_part_info
Definition: parse_tree_nodes.h:4473
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) final
Definition: parse_tree_nodes.h:4468
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4791
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4459
Definition: parse_tree_nodes.h:4602
PT_alter_table_partition_list_or_all super
Definition: parse_tree_nodes.h:4603
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4612
PT_alter_table_analyze_partition(const POS &pos, bool no_write_to_binlog, const List< String > *opt_partition_list)
Definition: parse_tree_nodes.h:4606
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4825
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4618
Definition: parse_tree_nodes.h:4136
const LEX_STRING m_old_name
Definition: parse_tree_nodes.h:4158
PT_alter_table_change_column(const POS &pos, const LEX_STRING &old_name, const LEX_STRING &new_name, PT_field_def_base *field_def, const char *opt_place)
Definition: parse_tree_nodes.h:4140
const LEX_STRING m_new_name
Definition: parse_tree_nodes.h:4159
const char * m_opt_place
Definition: parse_tree_nodes.h:4161
PT_field_def_base * m_field_def
Definition: parse_tree_nodes.h:4160
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:3064
PT_alter_table_change_column(const POS &pos, const LEX_STRING &name, PT_field_def_base *field_def, const char *opt_place)
Definition: parse_tree_nodes.h:4150
PT_alter_table_action super
Definition: parse_tree_nodes.h:4137
Definition: parse_tree_nodes.h:4622
PT_alter_table_check_partition(const POS &pos, const List< String > *opt_partition_list, uint flags, uint sql_flags)
Definition: parse_tree_nodes.h:4626
uint m_sql_flags
Definition: parse_tree_nodes.h:4642
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4832
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4635
PT_alter_table_partition_list_or_all super
Definition: parse_tree_nodes.h:4623
uint m_flags
Definition: parse_tree_nodes.h:4641
Definition: parse_tree_nodes.h:4672
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4689
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4673
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4684
PT_alter_table_coalesce_partition(const POS &pos, bool no_write_to_binlog, uint num_parts)
Definition: parse_tree_nodes.h:4676
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4855
const uint m_num_parts
Definition: parse_tree_nodes.h:4690
Definition: parse_tree_nodes.h:4296
Alter_column m_alter_column
Definition: parse_tree_nodes.h:4311
PT_alter_table_action super
Definition: parse_tree_nodes.h:4297
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4305
PT_alter_table_column_visibility(const POS &pos, const char *col_name, bool is_visible)
Definition: parse_tree_nodes.h:4300
Definition: parse_tree_nodes.h:4380
PT_alter_table_action super
Definition: parse_tree_nodes.h:4381
const CHARSET_INFO *const m_charset
Definition: parse_tree_nodes.h:4393
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:3120
const CHARSET_INFO *const m_collation
Definition: parse_tree_nodes.h:4394
PT_alter_table_convert_to_charset(const POS &pos, const CHARSET_INFO *charset, const CHARSET_INFO *opt_collation)
Definition: parse_tree_nodes.h:4384
Definition: parse_tree_nodes.h:4830
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4838
PT_alter_table_discard_partition_tablespace(const POS &pos, const List< String > *opt_partition_list)
Definition: parse_tree_nodes.h:4834
PT_alter_table_partition_list_or_all super
Definition: parse_tree_nodes.h:4831
Definition: parse_tree_nodes.h:4858
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4865
PT_alter_table_discard_tablespace(const POS &pos)
Definition: parse_tree_nodes.h:4862
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4859
Definition: parse_tree_nodes.h:4204
PT_alter_table_drop_check_constraint(const POS &pos, const char *name)
Definition: parse_tree_nodes.h:4206
Definition: parse_tree_nodes.h:4183
PT_alter_table_drop_column(const POS &pos, const char *name)
Definition: parse_tree_nodes.h:4185
Definition: parse_tree_nodes.h:4212
PT_alter_table_drop_constraint(const POS &pos, const char *name)
Definition: parse_tree_nodes.h:4214
Definition: parse_tree_nodes.h:4190
PT_alter_table_drop_foreign_key(const POS &pos, const char *name)
Definition: parse_tree_nodes.h:4192
Definition: parse_tree_nodes.h:4197
PT_alter_table_drop_key(const POS &pos, const char *name)
Definition: parse_tree_nodes.h:4199
Definition: parse_tree_nodes.h:4518
const List< String > m_partitions
Definition: parse_tree_nodes.h:4534
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4802
PT_alter_table_drop_partition(const POS &pos, const List< String > &partitions)
Definition: parse_tree_nodes.h:4522
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4519
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) final
Definition: parse_tree_nodes.h:4529
Definition: parse_tree_nodes.h:4164
PT_alter_table_action super
Definition: parse_tree_nodes.h:4165
PT_alter_table_drop(const POS &pos, Alter_drop::drop_type drop_type, Alter_info::Alter_info_flag alter_info_flag, const char *name)
Definition: parse_tree_nodes.h:4168
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4174
Alter_drop m_alter_drop
Definition: parse_tree_nodes.h:4180
Definition: parse_tree_nodes.h:4262
PT_alter_table_action super
Definition: parse_tree_nodes.h:4263
PT_alter_table_enable_keys(const POS &pos, bool enable)
Definition: parse_tree_nodes.h:4266
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4269
bool m_enable
Definition: parse_tree_nodes.h:4276
Definition: parse_tree_nodes.h:4250
PT_alter_table_enforce_check_constraint(const POS &pos, const char *name, bool is_enforced)
Definition: parse_tree_nodes.h:4252
Definition: parse_tree_nodes.h:4219
PT_alter_table_action super
Definition: parse_tree_nodes.h:4220
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4239
Alter_constraint_enforcement m_constraint_enforcement
Definition: parse_tree_nodes.h:4246
PT_alter_table_enforce_constraint(const POS &pos, const char *name, bool is_enforced)
Definition: parse_tree_nodes.h:4231
PT_alter_table_enforce_constraint(const POS &pos, Alter_constraint_enforcement::Type alter_type, Alter_info::Alter_info_flag alter_info_flag, const char *name, bool is_enforced)
Definition: parse_tree_nodes.h:4223
Definition: parse_tree_nodes.h:4763
PT_alter_table_exchange_partition(const POS &pos, const LEX_STRING &partition_name, Table_ident *table_name, Alter_info::enum_with_validation validation)
Definition: parse_tree_nodes.h:4767
Table_ident * m_table_name
Definition: parse_tree_nodes.h:4785
const Alter_info::enum_with_validation m_validation
Definition: parse_tree_nodes.h:4786
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4778
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:3187
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4764
const LEX_STRING m_partition_name
Definition: parse_tree_nodes.h:4784
Definition: parse_tree_nodes.h:4397
PT_alter_table_force(const POS &pos)
Definition: parse_tree_nodes.h:4401
PT_alter_table_action super
Definition: parse_tree_nodes.h:4398
Definition: parse_tree_nodes.h:4844
PT_alter_table_import_partition_tablespace(const POS &pos, const List< String > *opt_partition_list)
Definition: parse_tree_nodes.h:4848
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4852
PT_alter_table_partition_list_or_all super
Definition: parse_tree_nodes.h:4845
Definition: parse_tree_nodes.h:4871
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4872
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4878
PT_alter_table_import_tablespace(const POS &pos)
Definition: parse_tree_nodes.h:4875
Definition: parse_tree_nodes.h:4314
PT_alter_table_action super
Definition: parse_tree_nodes.h:4315
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4322
Alter_index_visibility m_alter_index_visibility
Definition: parse_tree_nodes.h:4329
PT_alter_table_index_visible(const POS &pos, const char *name, bool visible)
Definition: parse_tree_nodes.h:4318
Definition: parse_tree_nodes.h:4581
PT_alter_table_optimize_partition(const POS &pos, bool no_write_to_binlog, const List< String > *opt_partition_list)
Definition: parse_tree_nodes.h:4585
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4592
PT_alter_table_partition_list_or_all super
Definition: parse_tree_nodes.h:4582
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4598
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4818
Definition: parse_tree_nodes.h:4405
PT_alter_table_action super
Definition: parse_tree_nodes.h:4406
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4777
PT_alter_table_order(const POS &pos, PT_order_list *order)
Definition: parse_tree_nodes.h:4409
PT_order_list *const m_order
Definition: parse_tree_nodes.h:4415
Definition: parse_tree_nodes.h:4418
PT_alter_table_action super
Definition: parse_tree_nodes.h:4419
PT_partition *const m_partition
Definition: parse_tree_nodes.h:4428
PT_alter_table_partition_by(const POS &pos, PT_partition *partition)
Definition: parse_tree_nodes.h:4422
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4783
Definition: parse_tree_nodes.h:4538
PT_alter_table_partition_list_or_all(const POS &pos, Alter_info::Alter_info_flag alter_info_flag, const List< String > *opt_partition_list)
Definition: parse_tree_nodes.h:4542
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4547
const List< String > * m_opt_partition_list
Definition: parse_tree_nodes.h:4557
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4539
Definition: parse_tree_nodes.h:4561
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4572
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4811
PT_alter_table_partition_list_or_all super
Definition: parse_tree_nodes.h:4562
PT_alter_table_rebuild_partition(const POS &pos, bool no_write_to_binlog, const List< String > *opt_partition_list)
Definition: parse_tree_nodes.h:4565
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4577
Definition: parse_tree_nodes.h:4431
PT_alter_table_action super
Definition: parse_tree_nodes.h:4432
PT_alter_table_remove_partitioning(const POS &pos)
Definition: parse_tree_nodes.h:4435
Definition: parse_tree_nodes.h:4363
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4371
PT_alter_table_action super
Definition: parse_tree_nodes.h:4364
PT_alter_table_rename_column(const POS &pos, const char *from, const char *to)
Definition: parse_tree_nodes.h:4367
Alter_column m_rename_column
Definition: parse_tree_nodes.h:4377
Definition: parse_tree_nodes.h:4347
PT_alter_table_rename_key(const POS &pos, const char *from, const char *to)
Definition: parse_tree_nodes.h:4351
Alter_rename_key m_rename_key
Definition: parse_tree_nodes.h:4360
PT_alter_table_action super
Definition: parse_tree_nodes.h:4348
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4354
Definition: parse_tree_nodes.h:4332
PT_alter_table_rename(const POS &pos, const Table_ident *ident)
Definition: parse_tree_nodes.h:4336
const Table_ident *const m_ident
Definition: parse_tree_nodes.h:4344
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:3094
bool is_rename_table() const override
Definition: parse_tree_nodes.h:4341
PT_alter_table_action super
Definition: parse_tree_nodes.h:4333
Definition: parse_tree_nodes.h:4736
const Mem_root_array< PT_part_definition * > * m_into
Definition: parse_tree_nodes.h:4758
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:3166
partition_info m_partition_info
Definition: parse_tree_nodes.h:4759
PT_alter_table_reorganize_partition_into(const POS &pos, bool no_write_to_binlog, const List< String > &partition_names, const Mem_root_array< PT_part_definition * > *into)
Definition: parse_tree_nodes.h:4740
const List< String > m_partition_names
Definition: parse_tree_nodes.h:4757
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4737
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4756
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4751
Definition: parse_tree_nodes.h:4715
partition_info m_partition_info
Definition: parse_tree_nodes.h:4732
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4726
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4731
PT_alter_table_standalone_action super
Definition: parse_tree_nodes.h:4716
PT_alter_table_reorganize_partition(const POS &pos, bool no_write_to_binlog)
Definition: parse_tree_nodes.h:4719
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4870
Definition: parse_tree_nodes.h:4646
uint m_flags
Definition: parse_tree_nodes.h:4667
PT_alter_table_partition_list_or_all super
Definition: parse_tree_nodes.h:4647
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4666
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4842
uint m_sql_flags
Definition: parse_tree_nodes.h:4668
PT_alter_table_repair_partition(const POS &pos, bool no_write_to_binlog, const List< String > *opt_partition_list, uint flags, uint sql_flags)
Definition: parse_tree_nodes.h:4650
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4660
Definition: parse_tree_nodes.h:4790
PT_alter_table_secondary_load(const POS &pos, const List< String > *opt_use_partition=nullptr)
Definition: parse_tree_nodes.h:4796
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4801
const List< String > * opt_use_partition
Definition: parse_tree_nodes.h:4793
Definition: parse_tree_nodes.h:4810
PT_alter_table_secondary_unload(const POS &pos, const List< String > *opt_use_partition=nullptr)
Definition: parse_tree_nodes.h:4816
const List< String > * opt_use_partition
Definition: parse_tree_nodes.h:4813
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4821
Definition: parse_tree_nodes.h:4279
Item * m_expr
Definition: parse_tree_nodes.h:4293
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4743
const char * m_name
Definition: parse_tree_nodes.h:4292
PT_alter_table_action super
Definition: parse_tree_nodes.h:4280
PT_alter_table_set_default(const POS &pos, const char *col_name, Item *opt_default_expr)
Definition: parse_tree_nodes.h:4283
Definition: parse_tree_nodes.h:4439
PT_alter_table_action super
Definition: parse_tree_nodes.h:4440
PT_alter_table_standalone_action(const POS &pos, Alter_info::Alter_info_flag alter_info_flag)
Definition: parse_tree_nodes.h:4445
virtual Sql_cmd * make_cmd(Table_ddl_parse_context *pc)=0
Definition: parse_tree_nodes.h:4910
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3282
const Alter_info::enum_alter_table_algorithm m_algo
Definition: parse_tree_nodes.h:4930
const Alter_info::enum_alter_table_lock m_lock
Definition: parse_tree_nodes.h:4931
PT_alter_table_standalone_stmt(const POS &pos, MEM_ROOT *mem_root, Table_ident *table_name, PT_alter_table_standalone_action *action, Alter_info::enum_alter_table_algorithm algo, Alter_info::enum_alter_table_lock lock, Alter_info::enum_with_validation validation)
Definition: parse_tree_nodes.h:4912
Table_ident *const m_table_name
Definition: parse_tree_nodes.h:4928
PT_alter_table_standalone_action *const m_action
Definition: parse_tree_nodes.h:4929
const Alter_info::enum_with_validation m_validation
Definition: parse_tree_nodes.h:4932
HA_CREATE_INFO m_create_info
Definition: parse_tree_nodes.h:4934
Definition: parse_tree_nodes.h:4883
const Alter_info::enum_alter_table_lock m_lock
Definition: parse_tree_nodes.h:4904
const Alter_info::enum_with_validation m_validation
Definition: parse_tree_nodes.h:4905
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3244
Mem_root_array< PT_ddl_table_option * > *const m_opt_actions
Definition: parse_tree_nodes.h:4902
HA_CREATE_INFO m_create_info
Definition: parse_tree_nodes.h:4907
const Alter_info::enum_alter_table_algorithm m_algo
Definition: parse_tree_nodes.h:4903
Table_ident *const m_table_name
Definition: parse_tree_nodes.h:4901
PT_alter_table_stmt(const POS &pos, MEM_ROOT *mem_root, Table_ident *table_name, Mem_root_array< PT_ddl_table_option * > *opt_actions, Alter_info::enum_alter_table_algorithm algo, Alter_info::enum_alter_table_lock lock, Alter_info::enum_with_validation validation)
Definition: parse_tree_nodes.h:4885
Definition: parse_tree_nodes.h:4694
PT_alter_table_partition_list_or_all super
Definition: parse_tree_nodes.h:4695
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4864
Sql_cmd * make_cmd(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:4708
PT_alter_table_truncate_partition(const POS &pos, const List< String > *opt_partition_list)
Definition: parse_tree_nodes.h:4698
Definition: parse_tree_nodes.h:5318
const option_type m_comment
Definition: parse_tree_nodes.h:5340
bool do_contextualize(Alter_tablespace_parse_context *pc) override
Definition: parse_tree_nodes.h:5327
PT_alter_tablespace_option_comment(const POS &pos, option_type comment)
Definition: parse_tree_nodes.h:5323
decltype(Tablespace_options::ts_comment) option_type
Definition: parse_tree_nodes.h:5320
PT_alter_tablespace_option_base super
Definition: parse_tree_nodes.h:5319
Definition: parse_tree_nodes.h:5345
PT_alter_tablespace_option_engine(const POS &pos, option_type engine_name)
Definition: parse_tree_nodes.h:5350
bool do_contextualize(Alter_tablespace_parse_context *pc) override
Definition: parse_tree_nodes.h:5354
PT_alter_tablespace_option_base super
Definition: parse_tree_nodes.h:5346
decltype(Tablespace_options::engine_name) option_type
Definition: parse_tree_nodes.h:5347
const option_type m_engine_name
Definition: parse_tree_nodes.h:5367
Definition: parse_tree_nodes.h:5372
PT_alter_tablespace_option_file_block_size(const POS &pos, option_type file_block_size)
Definition: parse_tree_nodes.h:5377
const option_type m_file_block_size
Definition: parse_tree_nodes.h:5394
bool do_contextualize(Alter_tablespace_parse_context *pc) override
Definition: parse_tree_nodes.h:5381
decltype(Tablespace_options::file_block_size) option_type
Definition: parse_tree_nodes.h:5374
PT_alter_tablespace_option_base super
Definition: parse_tree_nodes.h:5373
Definition: parse_tree_nodes.h:5301
const option_type m_nodegroup_id
Definition: parse_tree_nodes.h:5313
PT_alter_tablespace_option_nodegroup(const POS &pos, option_type nodegroup_id)
Definition: parse_tree_nodes.h:5306
bool do_contextualize(Alter_tablespace_parse_context *pc) override
Definition: parse_tree_nodes.cc:4892
PT_alter_tablespace_option_base super
Definition: parse_tree_nodes.h:5302
decltype(Tablespace_options::nodegroup_id) option_type
Definition: parse_tree_nodes.h:5303
Definition: parse_tree_nodes.h:5247
const Option_type m_value
Definition: parse_tree_nodes.h:5260
PT_alter_tablespace_option_base super
Definition: parse_tree_nodes.h:5248
bool do_contextualize(Alter_tablespace_parse_context *pc) override
Definition: parse_tree_nodes.h:5254
PT_alter_tablespace_option(const POS &pos, Option_type value)
Definition: parse_tree_nodes.h:5251
Definition: parse_tree_nodes.h:3278
Sql_cmd_alter_user_default_role sql_cmd
Definition: parse_tree_nodes.h:3279
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4704
PT_alter_user_default_role(const POS &pos, bool if_exists, const List< LEX_USER > *users, const List< LEX_USER > *roles, const role_enum role_type)
Definition: parse_tree_nodes.h:3282
Definition: parse_tree_nodes.h:4959
const Sql_cmd_analyze_table::Histogram_command m_command
Definition: parse_tree_nodes.h:4981
PT_analyze_table_stmt(const POS &pos, MEM_ROOT *mem_root, bool no_write_to_binlog, Mem_root_array< Table_ident * > *table_list, Sql_cmd_analyze_table::Histogram_command command, int num_buckets, List< String > *columns, LEX_STRING data, bool auto_update)
Definition: parse_tree_nodes.h:4961
const int m_num_buckets
Definition: parse_tree_nodes.h:4982
const LEX_STRING m_data
Definition: parse_tree_nodes.h:4984
const bool m_auto_update
Definition: parse_tree_nodes.h:4985
const Mem_root_array< Table_ident * > * m_table_list
Definition: parse_tree_nodes.h:4980
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3315
List< String > * m_columns
Definition: parse_tree_nodes.h:4983
const bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4979
Definition: parse_tree_nodes.h:5059
List< Index_hint > * m_index_hints
Definition: parse_tree_nodes.h:5071
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:3404
Table_ddl_node super
Definition: parse_tree_nodes.h:5060
PT_assign_to_keycache(const POS &pos, Table_ident *table, List< Index_hint > *index_hints)
Definition: parse_tree_nodes.h:5063
Table_ident * m_table
Definition: parse_tree_nodes.h:5070
A template-free base class for index options that we can predeclare in sql_lex.h.
Definition: parse_tree_nodes.h:2250
PT_base_index_option(const POS &pos)
Definition: parse_tree_nodes.h:2252
A template for options that set HA_CREATE_INFO::table_options and also records if the option was expl...
Definition: parse_tree_nodes.h:2794
PT_create_table_option super
Definition: parse_tree_nodes.h:2795
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:2803
const bool value
Definition: parse_tree_nodes.h:2797
PT_bool_create_table_option(const POS &pos, bool value)
Definition: parse_tree_nodes.h:2800
Parse tree node for a single of a window extent's borders, cf.
Definition: parse_tree_nodes.h:1377
Item * build_addop(Item_cache *order_expr, bool prec, bool asc, const Window *window)
Definition: parse_tree_nodes.cc:3489
PT_border(const POS &pos, enum_window_border_type type, Item *value)
For bounded INTERVAL 2 DAYS, 'value' is 2, int_type is DAYS.
Definition: parse_tree_nodes.h:1392
PT_border(const POS &pos, enum_window_border_type type)
< For unbounded border
Definition: parse_tree_nodes.h:1386
Item * m_value
only relevant iff m_border_type == WBT_VALUE_*
Definition: parse_tree_nodes.h:1379
Item ** border_ptr()
Need such low-level access so that fix_fields updates the right pointer.
Definition: parse_tree_nodes.h:1410
interval_type m_int_type
Definition: parse_tree_nodes.h:1383
PT_border(const POS &pos, enum_window_border_type type, Item *value, interval_type int_type)
Definition: parse_tree_nodes.h:1399
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_window.cc:68
enum_window_border_type m_border_type
Definition: parse_tree_nodes.h:1381
const bool m_date_time
Definition: parse_tree_nodes.h:1382
Item * border() const
Definition: parse_tree_nodes.h:1408
Parse tree node for one or both of a window extent's borders, cf.
Definition: parse_tree_nodes.h:1429
PT_borders(const POS &pos, PT_border *start, PT_border *end)
Constructor.
Definition: parse_tree_nodes.h:1441
PT_border * m_borders[2]
Definition: parse_tree_nodes.h:1430
Definition: parse_tree_nodes.h:5103
List< Index_hint > * m_opt_key_usage_list
Definition: parse_tree_nodes.h:5121
PT_cache_index_partitions_stmt(const POS &pos, MEM_ROOT *mem_root, Table_ident *table, PT_adm_partition *partitions, List< Index_hint > *opt_key_usage_list, LEX_CSTRING key_cache_name)
Definition: parse_tree_nodes.h:5105
Table_ident * m_table
Definition: parse_tree_nodes.h:5119
PT_adm_partition * m_partitions
Definition: parse_tree_nodes.h:5120
const LEX_CSTRING m_key_cache_name
Definition: parse_tree_nodes.h:5122
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3438
Definition: parse_tree_nodes.h:5087
const LEX_CSTRING m_key_cache_name
Definition: parse_tree_nodes.h:5100
Mem_root_array< PT_assign_to_keycache * > * m_tbl_index_lists
Definition: parse_tree_nodes.h:5099
PT_cache_index_stmt(const POS &pos, MEM_ROOT *mem_root, Mem_root_array< PT_assign_to_keycache * > *tbl_index_lists, LEX_CSTRING key_cache_name)
Definition: parse_tree_nodes.h:5089
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3424
Definition: parse_tree_nodes.h:2131
PT_item_list * opt_expr_list
Definition: parse_tree_nodes.h:2133
sp_name * proc_name
Definition: parse_tree_nodes.h:2132
PT_call(const POS &pos, sp_name *proc_name_arg, PT_item_list *opt_expr_list_arg)
Definition: parse_tree_nodes.h:2136
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:1208
Definition: parse_tree_nodes.h:3003
void set_column_name(const LEX_STRING &name)
Definition: parse_tree_nodes.h:3015
PT_table_constraint_def super
Definition: parse_tree_nodes.h:3004
PT_check_constraint(const POS &pos, LEX_STRING &name, Item *expr, bool is_enforced)
Definition: parse_tree_nodes.h:3008
Sql_check_constraint_spec cc_spec
Definition: parse_tree_nodes.h:3005
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4621
Definition: parse_tree_nodes.h:4988
PT_check_table_stmt(const POS &pos, MEM_ROOT *mem_root, Mem_root_array< Table_ident * > *table_list, decltype(HA_CHECK_OPT::flags) flags, decltype(HA_CHECK_OPT::sql_flags) sql_flags)
Definition: parse_tree_nodes.h:4990
Mem_root_array< Table_ident * > * m_table_list
Definition: parse_tree_nodes.h:5002
decltype(HA_CHECK_OPT::flags) m_flags
Definition: parse_tree_nodes.h:5003
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3337
decltype(HA_CHECK_OPT::sql_flags) m_sql_flags
Definition: parse_tree_nodes.h:5004
Base class for all column attributes in CREATE/ALTER TABLE
Definition: parse_tree_column_attrs.h:85
Definition: parse_tree_nodes.h:3020
PT_table_element super
Definition: parse_tree_nodes.h:3021
PT_column_def(const POS &pos, const LEX_STRING &field_ident, PT_field_def_base *field_def, PT_table_constraint_def *opt_column_constraint, const char *opt_place=nullptr)
Definition: parse_tree_nodes.h:3031
const LEX_STRING field_ident
Definition: parse_tree_nodes.h:3023
PT_field_def_base * field_def
Definition: parse_tree_nodes.h:3024
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:2307
const char * opt_place
Definition: parse_tree_nodes.h:3028
PT_table_constraint_def * opt_column_constraint
Definition: parse_tree_nodes.h:3026
Represents an element of the WITH list: WITH [...], [...] SELECT ..., ^ or ^ i.e.
Definition: parse_tree_nodes.h:275
const LEX_STRING m_subq_text
Raw text of query expression (including parentheses)
Definition: parse_tree_nodes.h:315
const Create_col_name_list m_column_names
List of explicitly specified column names; if empty, no list.
Definition: parse_tree_nodes.h:324
Parse_tree_node super
Definition: parse_tree_nodes.h:276
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.cc:2065
bool is(const Common_table_expr *other) const
Definition: parse_tree_nodes.h:303
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:2056
PT_subquery *const m_subq_node
Parsed version of subq_text.
Definition: parse_tree_nodes.h:322
PT_common_table_expr(const POS &pos, const LEX_STRING &name, const LEX_STRING &subq_text, uint subq_text_offset, PT_subquery *sn, const Create_col_name_list *column_names, MEM_ROOT *mem_root)
Definition: parse_tree_nodes.cc:2038
uint m_subq_text_offset
Offset in bytes of m_subq_text in original statement which had the WITH clause.
Definition: parse_tree_nodes.h:320
void print(const THD *thd, String *str, enum_query_type query_type)
Definition: parse_tree_nodes.cc:2107
const LEX_STRING & name() const
The name after AS.
Definition: parse_tree_nodes.h:286
Common_table_expr m_postparse
A Table_ref representing a CTE needs access to the WITH list element it derives from.
Definition: parse_tree_nodes.h:334
LEX_STRING m_name
Definition: parse_tree_nodes.h:313
Definition: parse_tree_nodes.h:2435
PT_create_index_stmt(const POS &pos, MEM_ROOT *mem_root, keytype type_par, const LEX_STRING &name_arg, PT_base_index_option *type, Table_ident *table_ident, List< PT_key_part_specification > *cols, Index_options options, Alter_info::enum_alter_table_algorithm algo, Alter_info::enum_alter_table_lock lock)
Definition: parse_tree_nodes.h:2437
keytype m_keytype
Definition: parse_tree_nodes.h:2457
Index_options m_options
Definition: parse_tree_nodes.h:2462
Table_ident * m_table_ident
Definition: parse_tree_nodes.h:2460
LEX_STRING m_name
Definition: parse_tree_nodes.h:2458
const Alter_info::enum_alter_table_algorithm m_algo
Definition: parse_tree_nodes.h:2463
List< PT_key_part_specification > * m_columns
Definition: parse_tree_nodes.h:2461
const Alter_info::enum_alter_table_lock m_lock
Definition: parse_tree_nodes.h:2464
PT_base_index_option * m_type
Definition: parse_tree_nodes.h:2459
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:1873
Parse tree node for CREATE RESOURCE GROUP statement.
Definition: parse_tree_nodes.h:5401
resourcegroups::Sql_cmd_create_resource_group sql_cmd
Definition: parse_tree_nodes.h:5402
PT_create_resource_group(const POS &pos, const LEX_CSTRING &name, const resourcegroups::Type type, const Mem_root_array< resourcegroups::Range > *cpu_list, const Value_or_default< int > &opt_priority, bool enabled)
Definition: parse_tree_nodes.h:5406
const bool has_priority
Definition: parse_tree_nodes.h:5403
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4904
Definition: parse_tree_nodes.h:3124
PT_create_role(const POS &pos, bool if_not_exists, const List< LEX_USER > *roles)
Definition: parse_tree_nodes.h:3128
Sql_cmd_create_role sql_cmd
Definition: parse_tree_nodes.h:3125
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4633
Top-level node for the CREATE [OR REPLACE] SPATIAL REFERENCE SYSTEM statement.
Definition: parse_tree_nodes.h:2162
bool contains_control_char(char *str, size_t length)
Check if a UTF-8 string contains control characters.
Definition: parse_tree_nodes.h:2188
PT_create_srs(const POS &pos, unsigned long long srid, const Sql_cmd_srs_attributes &attributes, bool or_replace, bool if_not_exists)
Definition: parse_tree_nodes.h:2196
const Sql_cmd_srs_attributes m_attributes
All attributes except SRID.
Definition: parse_tree_nodes.h:2175
unsigned long long m_srid
SRID of the SRS to create.
Definition: parse_tree_nodes.h:2173
bool m_or_replace
Whether OR REPLACE is specified.
Definition: parse_tree_nodes.h:2166
Sql_cmd_create_srs sql_cmd
The SQL command object.
Definition: parse_tree_nodes.h:2164
bool m_if_not_exists
Whether IF NOT EXISTS is specified.
Definition: parse_tree_nodes.h:2168
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4464
Node for the STATS_AUTO_RECALC [=] <0|1|DEFAULT>) table option.
Definition: parse_tree_nodes.h:2892
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:2164
const Ternary_option value
Definition: parse_tree_nodes.h:2895
PT_create_stats_auto_recalc_option(const POS &pos, Ternary_option value)
Definition: parse_tree_nodes.h:2907
PT_create_table_option super
Definition: parse_tree_nodes.h:2893
Node for the STATS_SAMPLE_PAGES [=] <integer>|DEFAULT table option.
Definition: parse_tree_nodes.h:2918
const value_t value
Definition: parse_tree_nodes.h:2922
PT_create_stats_stable_pages(const POS &pos, value_t value)
Constructor for implicit number of pages.
Definition: parse_tree_nodes.h:2931
PT_create_table_option super
Definition: parse_tree_nodes.h:2919
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:2185
decltype(HA_CREATE_INFO::stats_sample_pages) value_t
Definition: parse_tree_nodes.h:2920
PT_create_stats_stable_pages(const POS &pos)
Constructor for the DEFAULT number of pages.
Definition: parse_tree_nodes.h:2938
Definition: parse_tree_nodes.h:2957
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:2966
const ha_storage_media value
Definition: parse_tree_nodes.h:2960
PT_create_storage_option(const POS &pos, ha_storage_media value)
Definition: parse_tree_nodes.h:2963
PT_create_table_option super
Definition: parse_tree_nodes.h:2958
Definition: parse_tree_nodes.h:2973
const CHARSET_INFO * value
Definition: parse_tree_nodes.h:2976
PT_create_table_default_charset(const POS &pos, const CHARSET_INFO *value)
Definition: parse_tree_nodes.h:2979
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:2244
PT_create_table_option super
Definition: parse_tree_nodes.h:2974
Definition: parse_tree_nodes.h:2988
PT_create_table_default_collation(const POS &pos, const CHARSET_INFO *value)
Definition: parse_tree_nodes.h:2994
const CHARSET_INFO * value
Definition: parse_tree_nodes.h:2991
PT_create_table_option super
Definition: parse_tree_nodes.h:2989
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:2265
Node for the ENGINE [=] <identifier>|<string> table option.
Definition: parse_tree_nodes.h:2848
const LEX_CSTRING engine
Definition: parse_tree_nodes.h:2851
PT_create_table_engine_option(const POS &pos, const LEX_CSTRING &engine)
Definition: parse_tree_nodes.h:2858
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:2145
PT_create_table_option super
Definition: parse_tree_nodes.h:2849
Base class for CREATE TABLE option nodes.
Definition: parse_tree_nodes.h:2564
PT_ddl_table_option super
Definition: parse_tree_nodes.h:2565
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:2573
~PT_create_table_option() override=0
PT_create_table_option(const POS &pos)
Definition: parse_tree_nodes.h:2568
Node for the SECONDARY_ENGINE [=] <identifier>|<string>|NULL table option.
Definition: parse_tree_nodes.h:2871
PT_create_table_secondary_engine_option(const POS &pos, const LEX_CSTRING &secondary_engine)
Definition: parse_tree_nodes.h:2877
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:2155
const LEX_CSTRING m_secondary_engine
Definition: parse_tree_nodes.h:2884
PT_create_table_secondary_engine_option(const POS &pos)
Definition: parse_tree_nodes.h:2875
Top-level node for the CREATE TABLE statement.
Definition: parse_tree_nodes.h:3049
On_duplicate on_duplicate
Definition: parse_tree_nodes.h:3056
PT_partition * opt_partitioning
Definition: parse_tree_nodes.h:3055
const Mem_root_array< PT_table_element * > * opt_table_element_list
Definition: parse_tree_nodes.h:3053
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2337
bool is_temporary
Definition: parse_tree_nodes.h:3050
const Mem_root_array< PT_create_table_option * > * opt_create_table_options
Definition: parse_tree_nodes.h:3054
PT_query_expression_body * opt_query_expression
Definition: parse_tree_nodes.h:3057
bool only_if_not_exists
Definition: parse_tree_nodes.h:3051
PT_create_table_stmt(const POS &pos, MEM_ROOT *mem_root, bool is_temporary, bool only_if_not_exists, Table_ident *table_name, const Mem_root_array< PT_table_element * > *opt_table_element_list, const Mem_root_array< PT_create_table_option * > *opt_create_table_options, PT_partition *opt_partitioning, On_duplicate on_duplicate, PT_query_expression_body *opt_query_expression)
Definition: parse_tree_nodes.h:3082
Table_ident * table_name
Definition: parse_tree_nodes.h:3052
Table_ident * opt_like_clause
Definition: parse_tree_nodes.h:3058
PT_create_table_stmt(const POS &pos, MEM_ROOT *mem_root, bool is_temporary, bool only_if_not_exists, Table_ident *table_name, Table_ident *opt_like_clause)
Definition: parse_tree_nodes.h:3107
HA_CREATE_INFO m_create_info
Definition: parse_tree_nodes.h:3060
Definition: parse_tree_nodes.h:2944
const Mem_root_array< Table_ident * > * tables
Definition: parse_tree_nodes.h:2947
PT_create_union_option(const POS &pos, const Mem_root_array< Table_ident * > *tables)
Definition: parse_tree_nodes.h:2950
PT_create_table_option super
Definition: parse_tree_nodes.h:2945
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:2194
Definition: parse_tree_nodes.h:636
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3964
PT_joined_table super
Definition: parse_tree_nodes.h:637
PT_cross_join(const POS &pos, PT_table_reference *tab1_node_arg, const POS &join_pos_arg, PT_joined_table_type Type_arg, PT_table_reference *tab2_node_arg)
Definition: parse_tree_nodes.h:640
Common base class for CREATE TABLE and ALTER TABLE option nodes.
Definition: parse_tree_nodes.h:2547
PT_ddl_table_option(const POS &pos)
Definition: parse_tree_nodes.h:2549
~PT_ddl_table_option() override=0
virtual bool is_rename_table() const
Definition: parse_tree_nodes.h:2554
Top-level node for the DELETE statement.
Definition: parse_tree_nodes.h:1932
bool add_table(Parse_context *pc, Table_ident *table)
Definition: parse_tree_nodes.cc:897
bool is_multitable() const
Definition: parse_tree_nodes.h:1993
Item * opt_where_clause
Definition: parse_tree_nodes.h:1944
Mem_root_array_YY< Table_ident * > table_list
Definition: parse_tree_nodes.h:1941
PT_delete(const POS &pos, PT_with_clause *with_clause_arg, PT_hint_list *opt_hints_arg, int opt_delete_options_arg, Table_ident *table_ident_arg, const LEX_CSTRING &opt_table_alias_arg, List< String > *opt_use_partition_arg, Item *opt_where_clause_arg, PT_order *opt_order_clause_arg, Item *opt_delete_limit_clause_arg)
Definition: parse_tree_nodes.h:1951
SQL_I_List< Table_ref > delete_tables
Definition: parse_tree_nodes.h:1947
Item * opt_delete_limit_clause
Definition: parse_tree_nodes.h:1946
Mem_root_array_YY< PT_table_reference * > join_table_list
Definition: parse_tree_nodes.h:1943
Table_ident * table_ident
Definition: parse_tree_nodes.h:1939
PT_delete(const POS &pos, PT_with_clause *with_clause_arg, PT_hint_list *opt_hints_arg, int opt_delete_options_arg, const Mem_root_array_YY< Table_ident * > &table_list_arg, const Mem_root_array_YY< PT_table_reference * > &join_table_list_arg, Item *opt_where_clause_arg)
Definition: parse_tree_nodes.h:1972
PT_with_clause * m_with_clause
Definition: parse_tree_nodes.h:1936
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:912
const int opt_delete_options
Definition: parse_tree_nodes.h:1938
Parse_tree_root super
Definition: parse_tree_nodes.h:1933
PT_order * opt_order_clause
Definition: parse_tree_nodes.h:1945
PT_hint_list * opt_hints
Definition: parse_tree_nodes.h:1937
const char *const opt_table_alias
Definition: parse_tree_nodes.h:1940
List< String > * opt_use_partition
Definition: parse_tree_nodes.h:1942
Definition: parse_tree_nodes.h:542
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.cc:1452
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1407
PT_subquery * m_subquery
Definition: parse_tree_nodes.h:557
const char *const m_table_alias
Definition: parse_tree_nodes.h:558
PT_table_reference super
Definition: parse_tree_nodes.h:543
PT_derived_table(const POS &pos, bool lateral, PT_subquery *subquery, const LEX_CSTRING &table_alias, Create_col_name_list *column_names)
Definition: parse_tree_nodes.cc:1395
bool m_lateral
Definition: parse_tree_nodes.h:556
const Create_col_name_list column_names
List of explicitly specified column names; if empty, no list.
Definition: parse_tree_nodes.h:560
Definition: parse_tree_nodes.h:5022
Alter_drop m_alter_drop
Definition: parse_tree_nodes.h:5043
Alter_info::enum_alter_table_algorithm m_algo
Definition: parse_tree_nodes.h:5040
const char * m_index_name
Definition: parse_tree_nodes.h:5038
Alter_info::enum_alter_table_lock m_lock
Definition: parse_tree_nodes.h:5041
PT_drop_index_stmt(const POS &pos, MEM_ROOT *mem_root, const char *index_name, Table_ident *table, Alter_info::enum_alter_table_algorithm algo, Alter_info::enum_alter_table_lock lock)
Definition: parse_tree_nodes.h:5024
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3373
Table_ident * m_table
Definition: parse_tree_nodes.h:5039
Parse tree node for DROP RESOURCE GROUP statement.
Definition: parse_tree_nodes.h:5443
PT_drop_resource_group(const POS &pos, const LEX_CSTRING &resource_group_name, bool force)
Definition: parse_tree_nodes.h:5447
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4937
resourcegroups::Sql_cmd_drop_resource_group sql_cmd
Definition: parse_tree_nodes.h:5444
Definition: parse_tree_nodes.h:3135
Sql_cmd_drop_role sql_cmd
Definition: parse_tree_nodes.h:3136
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4638
PT_drop_role(const POS &pos, bool ignore_errors, const List< LEX_USER > *roles)
Definition: parse_tree_nodes.h:3139
Top-level node for the DROP SPATIAL REFERENCE SYSTEM statement.
Definition: parse_tree_nodes.h:2213
Sql_cmd_drop_srs sql_cmd
The SQL command object.
Definition: parse_tree_nodes.h:2215
PT_drop_srs(const POS &pos, unsigned long long srid, bool if_exists)
Definition: parse_tree_nodes.h:2223
unsigned long long m_srid
SRID of the SRS to drop.
Definition: parse_tree_nodes.h:2220
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4600
Definition: parse_tree_nodes.h:3238
Privilege * get_privilege(THD *thd) override
Definition: parse_tree_nodes.cc:4674
LEX_STRING ident
Definition: parse_tree_nodes.h:3239
PT_dynamic_privilege(const POS &pos, const POS &errpos, const LEX_STRING &ident)
Definition: parse_tree_nodes.h:3242
Definition: parse_tree_nodes.h:1862
enum Setop_type type() const override
Definition: parse_tree_nodes.h:1868
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1813
PT_set_operation(const POS &pos, PT_query_expression_body *lhs, bool is_distinct, PT_query_expression_body *rhs, bool is_rhs_in_parentheses=false)
Definition: parse_tree_nodes.h:1805
Parse tree node for a window frame's exclusions, cf.
Definition: parse_tree_nodes.h:1452
enum_window_frame_exclusion m_exclusion
Definition: parse_tree_nodes.h:1453
PT_exclusion(const POS &pos, enum_window_frame_exclusion e)
Definition: parse_tree_nodes.h:1456
Definition: parse_tree_nodes.h:5469
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3629
PT_explain_for_connection(const POS &pos, my_thread_id thread_id)
Definition: parse_tree_nodes.h:5471
Sql_cmd_explain_other_thread m_cmd
Definition: parse_tree_nodes.h:5477
Definition: parse_tree_nodes.h:5480
PT_explain(const POS &pos, Explain_format_type format, bool is_analyze, bool is_explicit_format, Parse_tree_root *explainable_stmt, std::optional< std::string_view > explain_into_variable_name, LEX_CSTRING schema_name_for_explain)
Definition: parse_tree_nodes.h:5482
const bool m_analyze
Definition: parse_tree_nodes.h:5498
LEX_CSTRING m_schema_name_for_explain
Definition: parse_tree_nodes.h:5502
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3648
const bool m_explicit_format
Definition: parse_tree_nodes.h:5499
std::optional< std::string_view > m_explain_into_variable_name
Definition: parse_tree_nodes.h:5501
Parse_tree_root *const m_explainable_stmt
Definition: parse_tree_nodes.h:5500
const Explain_format_type m_format
Definition: parse_tree_nodes.h:5497
Definition: parse_tree_nodes.h:1615
PT_explicit_table(const POS &pos, const Query_options &options_arg, PT_item_list *item_list_arg, const Mem_root_array_YY< PT_table_reference * > &from_clause_arg)
Definition: parse_tree_nodes.h:1619
Base class for both generated and regular column definitions.
Definition: parse_tree_column_attrs.h:903
Definition: parse_tree_nodes.h:2508
List< Key_part_spec > * m_ref_list
Definition: parse_tree_nodes.h:2536
fk_option m_fk_delete_opt
Definition: parse_tree_nodes.h:2539
PT_foreign_key_definition(const POS &pos, const LEX_STRING &constraint_name, const LEX_STRING &key_name, List< PT_key_part_specification > *columns, Table_ident *referenced_table, List< Key_part_spec > *ref_list, fk_match_opt fk_match_option, fk_option fk_update_opt, fk_option fk_delete_opt)
Definition: parse_tree_nodes.h:2512
Table_ident * m_referenced_table
Definition: parse_tree_nodes.h:2535
fk_match_opt m_fk_match_option
Definition: parse_tree_nodes.h:2537
fk_option m_fk_update_opt
Definition: parse_tree_nodes.h:2538
const LEX_STRING m_key_name
Definition: parse_tree_nodes.h:2533
const LEX_STRING m_constraint_name
Definition: parse_tree_nodes.h:2532
PT_table_constraint_def super
Definition: parse_tree_nodes.h:2509
List< PT_key_part_specification > * m_columns
Definition: parse_tree_nodes.h:2534
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:1910
Parse tree node for a window's frame, cf.
Definition: parse_tree_nodes.h:1465
PT_border * m_to
Definition: parse_tree_nodes.h:1470
PT_frame(const POS &pos, enum_window_frame_unit unit, PT_borders *from_to, PT_exclusion *exclusion)
Definition: parse_tree_nodes.h:1477
bool m_originally_absent
If true, this is an artificial frame, not specified by the user.
Definition: parse_tree_nodes.h:1475
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_window.cc:60
enum_window_frame_unit m_query_expression
Definition: parse_tree_nodes.h:1467
PT_border * m_from
Definition: parse_tree_nodes.h:1469
PT_exclusion * m_exclusion
Definition: parse_tree_nodes.h:1472
Definition: parse_tree_nodes.h:258
PT_order_list super
Definition: parse_tree_nodes.h:259
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.h:264
PT_gorder_list(const POS &pos)
Definition: parse_tree_nodes.h:262
Definition: parse_tree_nodes.h:3249
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4678
const List< LEX_USER > * users
Definition: parse_tree_nodes.h:3251
const bool with_admin_option
Definition: parse_tree_nodes.h:3252
const Mem_root_array< PT_role_or_privilege * > * roles
Definition: parse_tree_nodes.h:3250
PT_grant_roles(const POS &pos, const Mem_root_array< PT_role_or_privilege * > *roles, const List< LEX_USER > *users, bool with_admin_option)
Definition: parse_tree_nodes.h:3255
Definition: parse_tree_nodes.h:707
olap_type olap
Definition: parse_tree_nodes.h:711
Parse_tree_node super
Definition: parse_tree_nodes.h:708
PT_group(const POS &pos, PT_order_list *group_list_arg, olap_type olap_arg)
Definition: parse_tree_nodes.h:721
PT_order_list * group_list
Definition: parse_tree_nodes.h:710
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.h:714
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:266
Definition: parse_tree_hints.h:100
A template for options that set a single <alter option> value in thd->lex->key_create_info.
Definition: parse_tree_nodes.h:2378
PT_index_option(const POS &pos, Option_type option_value)
Definition: parse_tree_nodes.h:2382
Option_type m_option_value
Definition: parse_tree_nodes.h:2391
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:2385
Definition: parse_tree_nodes.h:2482
Index_options m_options
Definition: parse_tree_nodes.h:2505
PT_inline_index_definition(const POS &pos, keytype type_par, const LEX_STRING &name_arg, PT_base_index_option *type, List< PT_key_part_specification > *cols, Index_options options)
Definition: parse_tree_nodes.h:2486
PT_table_constraint_def super
Definition: parse_tree_nodes.h:2483
keytype m_keytype
Definition: parse_tree_nodes.h:2501
PT_base_index_option * m_type
Definition: parse_tree_nodes.h:2503
List< PT_key_part_specification > * m_columns
Definition: parse_tree_nodes.h:2504
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:1898
const LEX_STRING m_name
Definition: parse_tree_nodes.h:2502
Definition: parse_tree_nodes.h:2043
virtual mem_root_deque< List_item * > & get_many_values()
Definition: parse_tree_nodes.h:2059
bool push_back(mem_root_deque< Item * > *x)
Definition: parse_tree_nodes.h:2054
PT_insert_values_list(const POS &pos, MEM_ROOT *mem_root)
Definition: parse_tree_nodes.h:2049
Parse_tree_node super
Definition: parse_tree_nodes.h:2044
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1031
mem_root_deque< List_item * > many_values
Definition: parse_tree_nodes.h:2046
Top-level node for the INSERT statement.
Definition: parse_tree_nodes.h:2070
PT_item_list *const opt_on_duplicate_column_list
Definition: parse_tree_nodes.h:2084
PT_item_list *const column_list
Definition: parse_tree_nodes.h:2079
PT_item_list *const opt_on_duplicate_value_list
Definition: parse_tree_nodes.h:2085
PT_hint_list * opt_hints
Definition: parse_tree_nodes.h:2074
bool has_query_block() const
Definition: parse_tree_nodes.h:2128
const bool is_replace
Definition: parse_tree_nodes.h:2073
PT_query_expression_body * insert_query_expression
Definition: parse_tree_nodes.h:2081
Create_col_name_list *const opt_values_column_list
Definition: parse_tree_nodes.h:2083
Parse_tree_root super
Definition: parse_tree_nodes.h:2071
Table_ident *const table_ident
Definition: parse_tree_nodes.h:2077
PT_insert_values_list * row_value_list
Definition: parse_tree_nodes.h:2080
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:1042
const char *const opt_values_table_alias
Definition: parse_tree_nodes.h:2082
List< String > *const opt_use_partition
Definition: parse_tree_nodes.h:2078
const bool ignore
Definition: parse_tree_nodes.h:2076
const thr_lock_type lock_option
Definition: parse_tree_nodes.h:2075
PT_insert(const POS &pos, bool is_replace_arg, PT_hint_list *opt_hints_arg, thr_lock_type lock_option_arg, bool ignore_arg, Table_ident *table_ident_arg, List< String > *opt_use_partition_arg, PT_item_list *column_list_arg, PT_insert_values_list *row_value_list_arg, PT_query_expression_body *insert_query_expression_arg, const LEX_CSTRING &opt_values_table_alias_arg, Create_col_name_list *opt_values_column_list_arg, PT_item_list *opt_on_duplicate_column_list_arg, PT_item_list *opt_on_duplicate_value_list_arg)
Definition: parse_tree_nodes.h:2088
Definition: parse_tree_nodes.h:5557
List< PT_install_component_set_element > * m_set_elements
Definition: parse_tree_nodes.h:5560
PT_install_component(const POS &pos, THD *thd, Mem_root_array_YY< LEX_STRING > urns, List< PT_install_component_set_element > *set_elements)
Definition: parse_tree_nodes.cc:5146
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:5167
Mem_root_array_YY< LEX_STRING > m_urns
Definition: parse_tree_nodes.h:5559
Definition: parse_tree_nodes.h:1871
enum Setop_type type() const override
Definition: parse_tree_nodes.h:1877
PT_set_operation(const POS &pos, PT_query_expression_body *lhs, bool is_distinct, PT_query_expression_body *rhs, bool is_rhs_in_parentheses=false)
Definition: parse_tree_nodes.h:1805
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1818
Definition: parse_tree_nodes.h:1310
sql_exchange m_exchange
Definition: parse_tree_nodes.h:1320
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4262
PT_into_destination super
Definition: parse_tree_nodes.h:1311
PT_into_destination_dumpfile(const POS &pos, const LEX_STRING &file_name_arg)
Definition: parse_tree_nodes.h:1314
Definition: parse_tree_nodes.h:1290
PT_into_destination_outfile(const POS &pos, const LEX_STRING &file_name_arg, const CHARSET_INFO *charset_arg, const Field_separators &field_term_arg, const Line_separators &line_term_arg)
Definition: parse_tree_nodes.h:1294
PT_into_destination super
Definition: parse_tree_nodes.h:1291
sql_exchange m_exchange
Definition: parse_tree_nodes.h:1307
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4253
Definition: parse_tree_nodes.h:1280
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4238
PT_into_destination(const POS &pos)
Definition: parse_tree_nodes.h:1284
Parse_tree_node super
Definition: parse_tree_nodes.h:1281
Definition: parse_tree_nodes.h:1162
PT_transaction_characteristic super
Definition: parse_tree_nodes.h:1163
PT_isolation_level(const POS &pos, enum_tx_isolation level)
Definition: parse_tree_nodes.h:1166
Wrapper class for an Item list head, used to allocate Item lists in the parser in a context-independe...
Definition: parse_tree_helpers.h:105
mem_root_deque< Item * > value
Definition: parse_tree_helpers.h:113
uint elements() const
Definition: parse_tree_helpers.h:124
Definition: parse_tree_nodes.h:649
Item * on
Definition: parse_tree_nodes.h:651
PT_joined_table super
Definition: parse_tree_nodes.h:650
PT_joined_table_on(const POS &pos, PT_table_reference *tab1_node_arg, const POS &join_pos_arg, PT_joined_table_type type, PT_table_reference *tab2_node_arg, Item *on_arg)
Definition: parse_tree_nodes.h:654
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3970
Definition: parse_tree_nodes.h:663
PT_joined_table_using(const POS &pos, PT_table_reference *tab1_node_arg, const POS &join_pos_arg, PT_joined_table_type type, PT_table_reference *tab2_node_arg, List< String > *using_fields_arg)
Definition: parse_tree_nodes.h:668
PT_joined_table_using(const POS &pos, PT_table_reference *tab1_node_arg, const POS &join_pos_arg, PT_joined_table_type type, PT_table_reference *tab2_node_arg)
A PT_joined_table_using without a list of columns denotes a natural join.
Definition: parse_tree_nodes.h:676
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.cc:4009
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3998
List< String > * using_fields
Definition: parse_tree_nodes.h:665
PT_joined_table super
Definition: parse_tree_nodes.h:664
Definition: parse_tree_nodes.h:576
Table_ref * m_left_table_ref
Definition: parse_tree_nodes.h:585
PT_table_reference super
Definition: parse_tree_nodes.h:577
void add_rhs(PT_table_reference *table)
Adds the table reference as the right-hand side of this join.
Definition: parse_tree_nodes.h:619
~PT_joined_table() override=0
This class is being inherited, it should thus be abstract.
PT_joined_table_type m_type
Definition: parse_tree_nodes.h:582
Table_ref * m_right_table_ref
Definition: parse_tree_nodes.h:586
POS m_join_pos
Definition: parse_tree_nodes.h:581
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3920
bool contextualize_tabs(Parse_context *pc)
Definition: parse_tree_nodes.cc:166
PT_joined_table(const POS &pos, PT_table_reference *tab1_node_arg, const POS &join_pos_arg, PT_joined_table_type type, PT_table_reference *tab2_node_arg)
Definition: parse_tree_nodes.h:589
PT_table_reference * m_left_pt_table
Definition: parse_tree_nodes.h:580
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.cc:3931
PT_table_reference * m_right_pt_table
Definition: parse_tree_nodes.h:583
PT_joined_table * add_cross_join(PT_cross_join *cj) override
Adds the cross join to this join operation.
Definition: parse_tree_nodes.h:613
Definition: parse_tree_nodes.h:5178
Json_table_column * get_column() override
Definition: parse_tree_nodes.h:5185
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3530
const char * m_name
Definition: parse_tree_nodes.h:5189
PT_json_table_column super
Definition: parse_tree_nodes.h:5179
unique_ptr_destroy_only< Json_table_column > m_column
Definition: parse_tree_nodes.h:5188
PT_json_table_column_for_ordinality(const POS &pos, LEX_STRING name)
Definition: parse_tree_nodes.cc:3523
Definition: parse_tree_nodes.h:5213
Json_table_column * get_column() override
Definition: parse_tree_nodes.h:5224
Item * m_path
Definition: parse_tree_nodes.h:5227
PT_json_table_column_with_nested_path(const POS &pos, Item *path, Mem_root_array< PT_json_table_column * > *nested_cols)
Definition: parse_tree_nodes.h:5217
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3609
PT_json_table_column super
Definition: parse_tree_nodes.h:5214
Json_table_column * m_column
Definition: parse_tree_nodes.h:5229
const Mem_root_array< PT_json_table_column * > * m_nested_columns
Definition: parse_tree_nodes.h:5228
Definition: parse_tree_nodes.h:5192
~PT_json_table_column_with_path() override
const CHARSET_INFO * m_collation
Definition: parse_tree_nodes.h:5209
unique_ptr_destroy_only< Json_table_column > m_column
Definition: parse_tree_nodes.h:5206
const char * m_name
Definition: parse_tree_nodes.h:5207
PT_json_table_column_with_path(const POS &pos, unique_ptr_destroy_only< Json_table_column > column, LEX_STRING name, PT_type *type, const CHARSET_INFO *collation)
Definition: parse_tree_nodes.cc:3540
PT_json_table_column super
Definition: parse_tree_nodes.h:5193
Json_table_column * get_column() override
Definition: parse_tree_nodes.h:5203
PT_type * m_type
Definition: parse_tree_nodes.h:5208
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3568
Definition: parse_tree_nodes.h:499
PT_json_table_column(const POS &pos)
Definition: parse_tree_nodes.h:501
virtual Json_table_column * get_column()=0
A key part specification.
Definition: parse_tree_nodes.h:2262
bool has_expression() const
Definition: parse_tree_nodes.h:2328
LEX_CSTRING m_column_name
The name of the column that this key part indexes.
Definition: parse_tree_nodes.h:2360
Parse_tree_node super
Definition: parse_tree_nodes.h:2263
bool is_explicit() const
Definition: parse_tree_nodes.h:2321
Item * get_expression() const
Get the indexed expression.
Definition: parse_tree_nodes.h:2305
LEX_CSTRING get_column_name() const
Get the column that this key part points to.
Definition: parse_tree_nodes.h:2337
enum_order get_order() const
Definition: parse_tree_nodes.h:2315
enum_order m_order
The direction of the index.
Definition: parse_tree_nodes.h:2357
bool do_contextualize(Parse_context *pc) override
Contextualize this key part specification.
Definition: parse_tree_nodes.cc:708
int get_prefix_length() const
Definition: parse_tree_nodes.h:2347
PT_key_part_specification(const POS &pos, Item *expression, enum_order order)
Constructor for a functional key part.
Definition: parse_tree_nodes.cc:694
int m_prefix_length
If this is greater than zero, it represents how many bytes of the column that is indexed.
Definition: parse_tree_nodes.h:2367
Item * m_expression
The indexed expression in case this is a functional key part.
Definition: parse_tree_nodes.h:2354
Definition: parse_tree_nodes.h:429
Parse_tree_node super
Definition: parse_tree_nodes.h:430
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.h:435
Limit_options limit_options
Definition: parse_tree_nodes.h:432
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3853
PT_limit_clause(const POS &pos, const Limit_options &limit_options_arg)
Definition: parse_tree_nodes.h:441
Definition: parse_tree_nodes.h:5144
List< Index_hint > * m_opt_cache_key_list
Definition: parse_tree_nodes.h:5162
bool m_ignore_leaves
Definition: parse_tree_nodes.h:5163
PT_adm_partition * m_partitions
Definition: parse_tree_nodes.h:5161
Table_ident * m_table
Definition: parse_tree_nodes.h:5160
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3456
PT_load_index_partitions_stmt(const POS &pos, MEM_ROOT *mem_root, Table_ident *table, PT_adm_partition *partitions, List< Index_hint > *opt_cache_key_list, bool ignore_leaves)
Definition: parse_tree_nodes.h:5146
Definition: parse_tree_nodes.h:5166
Mem_root_array< PT_preload_keys * > * m_preload_list
Definition: parse_tree_nodes.h:5175
PT_load_index_stmt(const POS &pos, MEM_ROOT *mem_root, Mem_root_array< PT_preload_keys * > *preload_list)
Definition: parse_tree_nodes.h:5168
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3474
Definition: parse_tree_nodes.h:5505
const thr_lock_type m_lock_type
Definition: parse_tree_nodes.h:5540
Sql_cmd_load_table m_cmd
Definition: parse_tree_nodes.h:5538
PT_load_table(const POS &pos, enum_filetype filetype, thr_lock_type lock_type, bool is_local_file, enum_source_type source_type, const LEX_STRING filename, ulong file_count, bool in_key_order, On_duplicate on_duplicate, Table_ident *table, List< String > *opt_partitions, const CHARSET_INFO *opt_charset, LEX_CSTRING compression_algorithm, String *opt_xml_rows_identified_by, const Field_separators &opt_field_separators, const Line_separators &opt_line_separators, ulong opt_ignore_lines, PT_item_list *opt_fields_or_vars, PT_item_list *opt_set_fields, PT_item_list *opt_set_exprs, List< String > *opt_set_expr_strings, ulong parallel, ulonglong memory_size, bool is_bulk_operation)
Definition: parse_tree_nodes.h:5507
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3780
Definition: parse_tree_nodes.h:801
PT_locking_clause_list(const POS &pos, MEM_ROOT *mem_root)
Definition: parse_tree_nodes.h:803
Mem_root_array_YY< PT_locking_clause * > m_locking_clauses
Definition: parse_tree_nodes.h:819
bool push_back(PT_locking_clause *locking_clause)
Definition: parse_tree_nodes.h:808
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.h:812
Definition: parse_tree_nodes.h:738
Lock_descriptor get_lock_descriptor() const
Definition: parse_tree_nodes.h:753
virtual bool set_lock_for_tables(Parse_context *pc)=0
Locked_row_action action() const
Definition: parse_tree_nodes.h:750
Locked_row_action m_locked_row_action
Definition: parse_tree_nodes.h:769
PT_locking_clause(const POS &pos, Lock_strength strength, Locked_row_action action)
Definition: parse_tree_nodes.h:740
Lock_strength m_lock_strength
Definition: parse_tree_nodes.h:768
bool do_contextualize(Parse_context *pc) final
Definition: parse_tree_nodes.cc:2271
Definition: parse_tree_nodes.h:1739
bool is_table_value_constructor() const override
Definition: parse_tree_nodes.h:1768
bool has_trailing_into_clause() const override
Definition: parse_tree_nodes.h:1762
PT_insert_values_list * get_row_value_list() const override
Definition: parse_tree_nodes.h:1772
PT_locking_clause_list *const m_locking_clauses
Definition: parse_tree_nodes.h:1778
bool is_set_operation() const override
Definition: parse_tree_nodes.h:1755
PT_locking(const POS &pos, PT_query_expression_body *qe, PT_locking_clause_list *locking_clauses)
Definition: parse_tree_nodes.h:1743
bool has_into_clause() const override
Definition: parse_tree_nodes.h:1759
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.h:1749
bool can_absorb_order_and_limit(bool order, bool limit) const override
True if this query expression can absorb an extraneous order by/limit clause.
Definition: parse_tree_nodes.h:1764
PT_query_expression_body *const m_query_expression
Definition: parse_tree_nodes.h:1777
Definition: parse_tree_nodes.h:5007
bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:5018
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3358
Mem_root_array< Table_ident * > * m_table_list
Definition: parse_tree_nodes.h:5019
PT_optimize_table_stmt(const POS &pos, MEM_ROOT *mem_root, bool no_write_to_binlog, Mem_root_array< Table_ident * > *table_list)
Definition: parse_tree_nodes.h:5009
Definition: parse_tree_nodes.h:1086
PT_option_value_list_head(const POS &pos, const POS &delimiter_pos_arg, Parse_tree_node *value_arg, const POS &value_pos_arg)
Definition: parse_tree_nodes.h:1094
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4123
Parse_tree_node super
Definition: parse_tree_nodes.h:1087
POS value_pos
Definition: parse_tree_nodes.h:1091
Parse_tree_node * value
Definition: parse_tree_nodes.h:1090
POS delimiter_pos
Definition: parse_tree_nodes.h:1089
Definition: parse_tree_nodes.h:1105
PT_option_value_list(const POS &pos, PT_option_value_list_head *head_arg, const POS &delimiter_pos_arg, Parse_tree_node *tail, const POS &tail_pos)
Definition: parse_tree_nodes.h:1111
PT_option_value_list_head * head
Definition: parse_tree_nodes.h:1108
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.h:1116
PT_option_value_list_head super
Definition: parse_tree_nodes.h:1106
Definition: parse_tree_nodes.h:970
const CHARSET_INFO * opt_charset
Definition: parse_tree_nodes.h:973
PT_option_value_no_option_type super
Definition: parse_tree_nodes.h:971
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:199
PT_option_value_no_option_type_charset(const POS &pos, const CHARSET_INFO *opt_charset_arg)
Definition: parse_tree_nodes.h:976
Definition: parse_tree_nodes.h:984
PT_option_value_no_option_type_names(const POS &pos, const POS &error_pos)
Definition: parse_tree_nodes.h:990
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:217
POS m_error_pos
Definition: parse_tree_nodes.h:987
PT_option_value_no_option_type super
Definition: parse_tree_nodes.h:985
Definition: parse_tree_nodes.h:1046
POS expr_pos
Definition: parse_tree_nodes.h:1054
bool retain_current_password
Definition: parse_tree_nodes.h:1052
PT_option_value_no_option_type_password_for(const POS &pos, LEX_USER *user_arg, const char *password_arg, const char *current_password_arg, bool retain_current, bool random_pass, const POS &expr_pos_arg)
Definition: parse_tree_nodes.h:1057
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:606
LEX_USER * user
Definition: parse_tree_nodes.h:1049
const char * password
Definition: parse_tree_nodes.h:1050
PT_start_option_value_list super
Definition: parse_tree_nodes.h:1047
bool random_password_generator
Definition: parse_tree_nodes.h:1053
const char * current_password
Definition: parse_tree_nodes.h:1051
Definition: parse_tree_nodes.h:1019
bool random_password_generator
Definition: parse_tree_nodes.h:1025
PT_option_value_no_option_type_password(const POS &pos, const char *password_arg, const char *current_password_arg, bool retain_current, bool random_password, const POS &expr_pos_arg)
Definition: parse_tree_nodes.h:1029
const char * current_password
Definition: parse_tree_nodes.h:1023
PT_start_option_value_list super
Definition: parse_tree_nodes.h:1020
POS expr_pos
Definition: parse_tree_nodes.h:1026
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:652
bool retain_current_password
Definition: parse_tree_nodes.h:1024
const char * password
Definition: parse_tree_nodes.h:1022
Definition: parse_tree_nodes.h:930
PT_option_value_no_option_type_user_var(const POS &pos, const LEX_STRING &name_arg, Item *expr_arg)
Definition: parse_tree_nodes.h:937
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4082
LEX_STRING name
Definition: parse_tree_nodes.h:933
PT_option_value_no_option_type super
Definition: parse_tree_nodes.h:931
Item * expr
Definition: parse_tree_nodes.h:934
Definition: parse_tree_nodes.h:899
PT_option_value_no_option_type(const POS &pos)
Definition: parse_tree_nodes.h:901
Definition: parse_tree_nodes.h:1072
enum_var_type type
Definition: parse_tree_nodes.h:1075
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4118
Parse_tree_node super
Definition: parse_tree_nodes.h:1073
PT_set_scoped_system_variable * value
Definition: parse_tree_nodes.h:1076
PT_option_value_type(const POS &pos, enum_var_type type_arg, PT_set_scoped_system_variable *value_arg)
Definition: parse_tree_nodes.h:1079
Definition: parse_tree_nodes.h:216
Parse_tree_node super
Definition: parse_tree_nodes.h:217
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.h:228
PT_order_expr(const POS &pos, Item *item_arg, enum_order dir)
Definition: parse_tree_nodes.h:220
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:328
Definition: parse_tree_nodes.h:234
void push_back(PT_order_expr *order)
Definition: parse_tree_nodes.h:251
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.h:243
Parse_tree_node super
Definition: parse_tree_nodes.h:235
PT_order_list(const POS &pos)
Definition: parse_tree_nodes.h:241
SQL_I_List< ORDER > value
Definition: parse_tree_nodes.h:238
Definition: parse_tree_nodes.h:727
Parse_tree_node super
Definition: parse_tree_nodes.h:728
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:311
PT_order(const POS &pos, PT_order_list *order_list_arg)
Definition: parse_tree_nodes.h:732
PT_order_list * order_list
Definition: parse_tree_nodes.h:731
Node for the PARTITION clause of CREATE/ALTER TABLE.
Definition: parse_tree_partitions.h:404
Node for the PARTITION definition clause.
Definition: parse_tree_partitions.h:625
Definition: parse_tree_nodes.h:5125
List< Index_hint > * m_opt_cache_key_list
Definition: parse_tree_nodes.h:5140
Table_ddl_node super
Definition: parse_tree_nodes.h:5126
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.cc:4878
PT_preload_keys(const POS &pos, Table_ident *table, List< Index_hint > *opt_cache_key_list, bool ignore_leaves)
Definition: parse_tree_nodes.h:5129
Table_ident * m_table
Definition: parse_tree_nodes.h:5139
bool m_ignore_leaves
Definition: parse_tree_nodes.h:5141
Definition: parse_tree_nodes.h:772
PT_query_block_locking_clause(const POS &pos, Lock_strength strength, Locked_row_action action=Locked_row_action::WAIT)
Definition: parse_tree_nodes.h:774
bool set_lock_for_tables(Parse_context *pc) override
Definition: parse_tree_nodes.cc:2293
Definition: parse_tree_nodes.h:822
virtual bool can_absorb_order_and_limit(bool order, bool limit) const =0
True if this query expression can absorb an extraneous order by/limit clause.
virtual bool is_table_value_constructor() const =0
virtual bool is_set_operation() const =0
virtual Setop_type type() const
Definition: parse_tree_nodes.h:826
Setop_type
Definition: parse_tree_nodes.h:825
@ UNION
Definition: parse_tree_nodes.h:825
@ EXCEPT
Definition: parse_tree_nodes.h:825
@ NONE
Definition: parse_tree_nodes.h:825
@ INTERSECT
Definition: parse_tree_nodes.h:825
virtual PT_insert_values_list * get_row_value_list() const =0
PT_query_expression_body(const POS &pos)
Definition: parse_tree_nodes.h:824
virtual bool has_into_clause() const =0
virtual bool has_trailing_into_clause() const =0
Definition: parse_tree_nodes.h:1626
PT_order * m_order
Definition: parse_tree_nodes.h:1730
bool contextualize_deferred_hints(Parse_context *pc)
Definition: parse_tree_nodes.h:1654
PT_limit_clause * m_limit
Definition: parse_tree_nodes.h:1731
bool is_set_operation() const override
Definition: parse_tree_nodes.h:1646
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4291
PT_query_expression(const POS &pos, PT_with_clause *with_clause, PT_query_expression_body *body, PT_order *order, PT_limit_clause *limit)
Definition: parse_tree_nodes.h:1628
PT_query_expression_body * m_body
Definition: parse_tree_nodes.h:1729
bool has_into_clause() const override
Definition: parse_tree_nodes.h:1648
bool has_trailing_into_clause() const override
Definition: parse_tree_nodes.h:1649
PT_query_expression(const POS &pos, PT_query_expression_body *body)
Definition: parse_tree_nodes.h:1641
bool contextualize_order_and_limit(Parse_context *pc)
Contextualizes the order and limit clauses, re-interpreting them according to the rules.
Definition: parse_tree_nodes.cc:1329
bool can_absorb_order_and_limit(bool order, bool limit) const override
True if this query expression can absorb an extraneous order by/limit clause.
Definition: parse_tree_nodes.h:1661
PT_insert_values_list * get_row_value_list() const override
Definition: parse_tree_nodes.h:1713
PT_query_expression(const POS &pos, PT_query_expression_body *body, PT_order *order, PT_limit_clause *limit)
Definition: parse_tree_nodes.h:1637
PT_with_clause * m_with_clause
Definition: parse_tree_nodes.h:1732
bool is_table_value_constructor() const override
Definition: parse_tree_nodes.h:1709
Definition: parse_tree_nodes.h:1488
PT_query_primary(const POS &pos)
Definition: parse_tree_nodes.h:1490
Definition: parse_tree_nodes.h:1493
bool is_implicit_from_clause() const
Definition: parse_tree_nodes.h:1586
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1226
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.cc:1299
PT_into_destination * opt_into1
Definition: parse_tree_nodes.h:1499
PT_query_specification(const POS &pos, PT_hint_list *opt_hints_arg, const Query_options &options_arg, PT_item_list *item_list_arg, PT_into_destination *opt_into1_arg, const Mem_root_array_YY< PT_table_reference * > &from_clause_arg, Item *opt_where_clause_arg, PT_group *opt_group_clause_arg, Item *opt_having_clause_arg, PT_window_list *opt_window_clause_arg, Item *opt_qualify_clause_arg, bool implicit_from_clause)
Definition: parse_tree_nodes.h:1509
PT_hint_list * opt_hints
Definition: parse_tree_nodes.h:1496
PT_query_specification(const POS &pos, const Query_options &options_arg, PT_item_list *item_list_arg)
Definition: parse_tree_nodes.h:1550
Item * opt_having_clause
Definition: parse_tree_nodes.h:1504
PT_insert_values_list * get_row_value_list() const override
Definition: parse_tree_nodes.h:1580
PT_window_list * opt_window_clause
Definition: parse_tree_nodes.h:1505
const bool m_is_from_clause_implicit
Definition: parse_tree_nodes.h:1500
bool is_set_operation() const override
Definition: parse_tree_nodes.h:1575
bool has_into_clause() const override
Definition: parse_tree_nodes.h:1567
PT_item_list * item_list
Definition: parse_tree_nodes.h:1498
Mem_root_array_YY< PT_table_reference * > from_clause
Definition: parse_tree_nodes.h:1501
bool is_table_value_constructor() const override
Definition: parse_tree_nodes.h:1579
Query_options options
Definition: parse_tree_nodes.h:1497
PT_group * opt_group_clause
Definition: parse_tree_nodes.h:1503
bool can_absorb_order_and_limit(bool, bool) const override
True if this query expression can absorb an extraneous order by/limit clause.
Definition: parse_tree_nodes.h:1577
Item * opt_qualify_clause
Definition: parse_tree_nodes.h:1506
bool has_trailing_into_clause() const override
Definition: parse_tree_nodes.h:1568
PT_query_specification(const POS &pos, const Query_options &options_arg, PT_item_list *item_list_arg, const Mem_root_array_YY< PT_table_reference * > &from_clause_arg, Item *opt_where_clause_arg)
Definition: parse_tree_nodes.h:1532
Item * opt_where_clause
Definition: parse_tree_nodes.h:1502
PT_query_primary super
Definition: parse_tree_nodes.h:1494
Definition: parse_tree_nodes.h:4937
Mem_root_array< Table_ident * > * m_table_list
Definition: parse_tree_nodes.h:4954
bool m_no_write_to_binlog
Definition: parse_tree_nodes.h:4953
PT_repair_table_stmt(const POS &pos, MEM_ROOT *mem_root, bool no_write_to_binlog, Mem_root_array< Table_ident * > *table_list, decltype(HA_CHECK_OPT::flags) flags, decltype(HA_CHECK_OPT::sql_flags) sql_flags)
Definition: parse_tree_nodes.h:4939
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3297
decltype(HA_CHECK_OPT::sql_flags) m_sql_flags
Definition: parse_tree_nodes.h:4956
decltype(HA_CHECK_OPT::flags) m_flags
Definition: parse_tree_nodes.h:4955
Top-level node for the SHUTDOWN statement.
Definition: parse_tree_nodes.h:5549
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4957
Sql_cmd_restart_server sql_cmd
Definition: parse_tree_nodes.h:5554
Definition: parse_tree_nodes.h:3266
const Mem_root_array< PT_role_or_privilege * > * roles
Definition: parse_tree_nodes.h:3267
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4692
const List< LEX_USER > * users
Definition: parse_tree_nodes.h:3268
PT_revoke_roles(const POS &pos, Mem_root_array< PT_role_or_privilege * > *roles, const List< LEX_USER > *users)
Definition: parse_tree_nodes.h:3271
Definition: parse_tree_nodes.h:3202
LEX_STRING role
Definition: parse_tree_nodes.h:3203
LEX_STRING host
Definition: parse_tree_nodes.h:3204
PT_role_at_host(const POS &pos, const POS &errpos, const LEX_STRING &role, const LEX_STRING &host)
Definition: parse_tree_nodes.h:3207
LEX_USER * get_user(THD *thd) override
Definition: parse_tree_nodes.cc:4658
Definition: parse_tree_nodes.h:3214
LEX_STRING ident
Definition: parse_tree_nodes.h:3215
Privilege * get_privilege(THD *thd) override
Definition: parse_tree_nodes.cc:4666
LEX_USER * get_user(THD *thd) override
Definition: parse_tree_nodes.cc:4662
PT_role_or_dynamic_privilege(const POS &pos, const POS &errpos, const LEX_STRING &ident)
Definition: parse_tree_nodes.h:3218
Definition: parse_tree_nodes.h:3191
virtual LEX_USER * get_user(THD *thd)
Definition: parse_tree_nodes.cc:4648
virtual Privilege * get_privilege(THD *thd)
Definition: parse_tree_nodes.cc:4653
POS m_errpos
Definition: parse_tree_nodes.h:3193
PT_role_or_privilege(const POS &pos, const POS &errpos)
Definition: parse_tree_nodes.h:3196
Definition: parse_tree_nodes.h:420
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3847
PT_select_item_list(const POS &pos)
Definition: parse_tree_nodes.h:424
PT_item_list super
Definition: parse_tree_nodes.h:421
Definition: parse_tree_nodes.h:1337
sp_head * sp
Definition: parse_tree_nodes.h:1347
PT_select_sp_var(const POS &pos, const LEX_STRING &name_arg)
Definition: parse_tree_nodes.h:1351
uint offset
Definition: parse_tree_nodes.h:1340
uint get_offset() const override
Definition: parse_tree_nodes.h:1355
PT_select_var super
Definition: parse_tree_nodes.h:1338
bool is_local() const override
Definition: parse_tree_nodes.h:1354
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:712
Definition: parse_tree_nodes.h:1880
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:761
PT_query_expression_body * m_qe
Definition: parse_tree_nodes.h:1922
const bool m_has_trailing_locking_clauses
Definition: parse_tree_nodes.h:1924
PT_into_destination * m_into
Definition: parse_tree_nodes.h:1923
std::string get_printable_parse_tree(THD *thd) override
Definition: parse_tree_nodes.cc:732
Parse_tree_root super
Definition: parse_tree_nodes.h:1881
PT_select_stmt(const POS &pos, enum_sql_command sql_command, PT_query_expression_body *qe)
Definition: parse_tree_nodes.h:1889
enum_sql_command m_sql_command
Definition: parse_tree_nodes.h:1921
PT_select_stmt(const POS &pos, PT_query_expression_body *qe, PT_into_destination *into=nullptr, bool has_trailing_locking_clauses=false)
Creates a SELECT command.
Definition: parse_tree_nodes.h:1908
Definition: parse_tree_nodes.h:1360
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4271
List< PT_select_var > value
Definition: parse_tree_nodes.h:1366
PT_into_destination super
Definition: parse_tree_nodes.h:1361
bool push_back(PT_select_var *var)
Definition: parse_tree_nodes.h:1370
PT_select_var_list(const POS &pos)
Definition: parse_tree_nodes.h:1364
Definition: parse_tree_nodes.h:1323
const LEX_STRING name
Definition: parse_tree_nodes.h:1325
virtual bool is_local() const
Definition: parse_tree_nodes.h:1330
virtual uint get_offset() const
Definition: parse_tree_nodes.h:1331
PT_select_var(const POS &pos, const LEX_STRING &name_arg)
Definition: parse_tree_nodes.h:1327
Definition: parse_tree_nodes.h:997
PT_option_value_no_option_type super
Definition: parse_tree_nodes.h:998
const CHARSET_INFO * opt_charset
Definition: parse_tree_nodes.h:1000
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:233
PT_set_names(const POS &pos, const CHARSET_INFO *opt_charset_arg, const CHARSET_INFO *opt_collation_arg)
Definition: parse_tree_nodes.h:1004
const CHARSET_INFO * opt_collation
Definition: parse_tree_nodes.h:1001
Definition: parse_tree_nodes.h:1801
bool has_trailing_into_clause() const override
Definition: parse_tree_nodes.h:1825
bool m_is_distinct
Definition: parse_tree_nodes.h:1843
bool can_absorb_order_and_limit(bool, bool) const override
True if this query expression can absorb an extraneous order by/limit clause.
Definition: parse_tree_nodes.h:1830
bool is_distinct() const
Definition: parse_tree_nodes.h:1834
void merge_descendants(Parse_context *pc, Query_term_set_op *setop, QueryLevel &ql)
Possibly merge lower syntactic levels of set operations (UNION, INTERSECT and EXCEPT) into setop,...
Definition: parse_tree_nodes.cc:1629
PT_into_destination * m_into
Definition: parse_tree_nodes.h:1844
PT_insert_values_list * get_row_value_list() const override
Definition: parse_tree_nodes.h:1833
PT_set_operation(const POS &pos, PT_query_expression_body *lhs, bool is_distinct, PT_query_expression_body *rhs, bool is_rhs_in_parentheses=false)
Definition: parse_tree_nodes.h:1805
bool has_into_clause() const override
Definition: parse_tree_nodes.h:1819
void set_is_rhs_in_parentheses(bool v)
Definition: parse_tree_nodes.h:1837
bool m_is_rhs_in_parentheses
Definition: parse_tree_nodes.h:1845
bool is_set_operation() const override
Definition: parse_tree_nodes.h:1817
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.h:1846
bool is_table_value_constructor() const override
Definition: parse_tree_nodes.h:1832
List< PT_query_expression_body > m_list
Definition: parse_tree_nodes.h:1836
bool contextualize_setop(Parse_context *pc, Query_term_type setop_type, Surrounding_context context)
Definition: parse_tree_nodes.cc:1763
void merge_children(Query_term_set_op *setop, Query_term_set_op *lower)
Append the children of 'lower' to those of 'setop'.
Definition: parse_tree_nodes.cc:1502
Parse tree node for SET RESOURCE GROUP statement.
Definition: parse_tree_nodes.h:5458
PT_set_resource_group(const POS &pos, const LEX_CSTRING &name, Mem_root_array< ulonglong > *thread_id_list)
Definition: parse_tree_nodes.h:5462
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4947
resourcegroups::Sql_cmd_set_resource_group sql_cmd
Definition: parse_tree_nodes.h:5459
Definition: parse_tree_nodes.h:3146
PT_set_role(const POS &pos, const List< LEX_USER > *roles)
Definition: parse_tree_nodes.h:3155
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4643
PT_set_role(const POS &pos, role_enum role_type, const List< LEX_USER > *opt_except_roles=nullptr)
Definition: parse_tree_nodes.h:3150
Sql_cmd_set_role sql_cmd
Definition: parse_tree_nodes.h:3147
Definition: parse_tree_nodes.h:877
Parse_tree_node super
Definition: parse_tree_nodes.h:878
const LEX_CSTRING m_name
Definition: parse_tree_nodes.h:895
PT_set_scoped_system_variable(const POS &pos, const POS &var_pos, const LEX_CSTRING &opt_prefix, const LEX_CSTRING &name, Item *opt_expr)
Definition: parse_tree_nodes.h:881
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4040
const POS m_varpos
Definition: parse_tree_nodes.h:893
const LEX_CSTRING m_opt_prefix
Definition: parse_tree_nodes.h:894
Item * m_opt_expr
Definition: parse_tree_nodes.h:896
Definition: parse_tree_nodes.h:945
const enum_var_type m_scope
Definition: parse_tree_nodes.h:962
PT_option_value_no_option_type super
Definition: parse_tree_nodes.h:946
const LEX_CSTRING m_opt_prefix
Definition: parse_tree_nodes.h:964
const LEX_CSTRING m_name
Definition: parse_tree_nodes.h:965
Item * m_opt_expr
Definition: parse_tree_nodes.h:966
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4095
PT_set_system_variable(const POS &pos, enum_var_type scope, const POS &name_pos, const LEX_CSTRING &opt_prefix, const LEX_CSTRING &name, Item *opt_expr)
Definition: parse_tree_nodes.h:949
const POS m_name_pos
Definition: parse_tree_nodes.h:963
Definition: parse_tree_nodes.h:905
Item * m_opt_expr
Definition: parse_tree_nodes.h:926
PT_set_variable(const POS &pos, const POS &varpos, const LEX_CSTRING &opt_prefix, const LEX_CSTRING &name, const POS &expr_pos, Item *opt_expr)
Definition: parse_tree_nodes.h:909
PT_option_value_no_option_type super
Definition: parse_tree_nodes.h:906
const POS m_expr_pos
Definition: parse_tree_nodes.h:925
const LEX_CSTRING m_opt_prefix
Definition: parse_tree_nodes.h:923
const POS m_varpos
Definition: parse_tree_nodes.h:922
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:524
const LEX_CSTRING m_name
Definition: parse_tree_nodes.h:924
Definition: parse_tree_nodes.h:1266
Parse_tree_node super
Definition: parse_tree_nodes.h:1267
POS set_pos
Definition: parse_tree_nodes.h:1269
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4221
PT_start_option_value_list * list
Definition: parse_tree_nodes.h:1270
PT_set(const POS &pos, const POS &set_pos_arg, PT_start_option_value_list *list_arg)
Definition: parse_tree_nodes.h:1273
Base class for Parse tree nodes of SHOW statements.
Definition: parse_tree_nodes.h:3293
PT_show_base(const POS &pos, enum_sql_command sql_command)
Definition: parse_tree_nodes.h:3295
enum_sql_command m_sql_command
SQL command.
Definition: parse_tree_nodes.h:3299
Parse tree node for SHOW BINARY LOG STATUS statement.
Definition: parse_tree_nodes.h:3750
PT_show_binary_log_status(const POS &pos)
Definition: parse_tree_nodes.h:3752
Sql_cmd_show_binary_log_status m_sql_cmd
Definition: parse_tree_nodes.h:3758
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2833
Parse tree node for SHOW BINLOG EVENTS statement.
Definition: parse_tree_nodes.h:3367
PT_limit_clause *const m_opt_limit_clause
Definition: parse_tree_nodes.h:3379
Sql_cmd_show_binlog_events m_sql_cmd
Definition: parse_tree_nodes.h:3381
PT_show_binlog_events(const POS &pos, const LEX_STRING opt_log_file_name={}, PT_limit_clause *opt_limit_clause=nullptr)
Definition: parse_tree_nodes.h:3369
const LEX_STRING m_opt_log_file_name
Definition: parse_tree_nodes.h:3378
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2567
Parse tree node for SHOW BINLOGS statement.
Definition: parse_tree_nodes.h:3386
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2579
PT_show_binlogs(const POS &pos)
Definition: parse_tree_nodes.h:3388
Sql_cmd_show_binlogs m_sql_cmd
Definition: parse_tree_nodes.h:3393
Parse tree node for SHOW CHARACTER SET statement.
Definition: parse_tree_nodes.h:3398
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2586
PT_show_charsets(const POS &pos, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3400
Sql_cmd_show_charsets m_sql_cmd
Definition: parse_tree_nodes.h:3406
Parse tree node for SHOW COLLATIONS statement.
Definition: parse_tree_nodes.h:3411
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2599
PT_show_collations(const POS &pos, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3413
Sql_cmd_show_collations m_sql_cmd
Definition: parse_tree_nodes.h:3419
Base class for Parse tree nodes of SHOW COUNT(*) { WARNINGS | ERRORS } statements.
Definition: parse_tree_nodes.h:3425
Sql_cmd * make_cmd_generic(THD *thd, LEX_CSTRING diagnostic_variable_name)
Definition: parse_tree_nodes.cc:2612
PT_show_count_base(const POS &pos)
Definition: parse_tree_nodes.h:3427
Parse tree node for SHOW COUNT(*) ERRORS.
Definition: parse_tree_nodes.h:3436
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.h:3440
PT_show_count_errors(const POS &pos)
Definition: parse_tree_nodes.h:3438
Parse tree node for SHOW COUNT(*) WARNINGS.
Definition: parse_tree_nodes.h:3447
PT_show_count_warnings(const POS &pos)
Definition: parse_tree_nodes.h:3449
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.h:3451
Parse tree node for SHOW CREATE DATABASE statement.
Definition: parse_tree_nodes.h:3458
const LEX_STRING m_name
Definition: parse_tree_nodes.h:3470
PT_show_create_database(const POS &pos, bool if_not_exists, const LEX_STRING &name)
Definition: parse_tree_nodes.h:3460
Sql_cmd_show_create_database m_sql_cmd
Definition: parse_tree_nodes.h:3472
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2644
const bool m_if_not_exists
Definition: parse_tree_nodes.h:3469
Parse tree node for SHOW CREATE EVENT statement.
Definition: parse_tree_nodes.h:3477
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2657
sp_name *const m_spname
Definition: parse_tree_nodes.h:3485
PT_show_create_event(const POS &pos, sp_name *event_name)
Definition: parse_tree_nodes.h:3479
Sql_cmd_show_create_event m_sql_cmd
Definition: parse_tree_nodes.h:3487
Parse tree node for SHOW CREATE FUNCTION statement.
Definition: parse_tree_nodes.h:3492
Sql_cmd_show_create_function m_sql_cmd
Definition: parse_tree_nodes.h:3502
PT_show_create_function(const POS &pos, sp_name *function_name)
Definition: parse_tree_nodes.h:3494
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2666
sp_name *const m_spname
Definition: parse_tree_nodes.h:3500
Parse tree node for SHOW CREATE PROCEDURE statement.
Definition: parse_tree_nodes.h:3507
Sql_cmd_show_create_procedure m_sql_cmd
Definition: parse_tree_nodes.h:3517
sp_name *const m_spname
Definition: parse_tree_nodes.h:3515
PT_show_create_procedure(const POS &pos, sp_name *procedure_name)
Definition: parse_tree_nodes.h:3509
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2675
Parse tree node for SHOW CREATE TABLE and VIEW statements.
Definition: parse_tree_nodes.h:3522
Sql_cmd_show_create_table m_sql_cmd
Definition: parse_tree_nodes.h:3530
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2684
PT_show_create_table(const POS &pos, Table_ident *table_ident)
Definition: parse_tree_nodes.h:3524
Parse tree node for SHOW CREATE TRIGGER statement.
Definition: parse_tree_nodes.h:3535
PT_show_create_trigger(const POS &pos, sp_name *trigger_name)
Definition: parse_tree_nodes.h:3537
Sql_cmd_show_create_trigger m_sql_cmd
Definition: parse_tree_nodes.h:3545
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2703
sp_name *const m_spname
Definition: parse_tree_nodes.h:3543
Parse tree node for SHOW CREATE USER statement.
Definition: parse_tree_nodes.h:3550
Sql_cmd_show_create_user m_sql_cmd
Definition: parse_tree_nodes.h:3560
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2712
PT_show_create_user(const POS &pos, LEX_USER *user)
Definition: parse_tree_nodes.h:3552
LEX_USER *const m_user
Definition: parse_tree_nodes.h:3558
Parse tree node for SHOW CREATE VIEW statement.
Definition: parse_tree_nodes.h:3565
PT_show_create_view(const POS &pos, Table_ident *table_ident)
Definition: parse_tree_nodes.h:3567
Sql_cmd_show_create_table m_sql_cmd
Definition: parse_tree_nodes.h:3573
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2696
Parse tree node for SHOW DATABASES statement.
Definition: parse_tree_nodes.h:3578
Sql_cmd_show_databases m_sql_cmd
Definition: parse_tree_nodes.h:3586
PT_show_databases(const POS &pos, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3580
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2721
Parse tree node for SHOW ENGINE statements.
Definition: parse_tree_nodes.h:3591
PT_show_engine_base(const POS &pos, enum enum_sql_command sql_command, const LEX_STRING opt_engine={})
Definition: parse_tree_nodes.h:3593
LEX_STRING m_engine
Definition: parse_tree_nodes.h:3599
bool m_all
Definition: parse_tree_nodes.h:3600
Parse tree node for SHOW ENGINE LOGS statement.
Definition: parse_tree_nodes.h:3605
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2734
PT_show_engine_logs(const POS &pos, LEX_STRING opt_engine={})
Definition: parse_tree_nodes.h:3607
Sql_cmd_show_engine_logs m_sql_cmd
Definition: parse_tree_nodes.h:3613
Parse tree node for SHOW ENGINE MUTEX statement.
Definition: parse_tree_nodes.h:3618
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2748
Sql_cmd_show_engine_mutex m_sql_cmd
Definition: parse_tree_nodes.h:3626
PT_show_engine_mutex(const POS &pos, LEX_STRING opt_engine={})
Definition: parse_tree_nodes.h:3620
Parse tree node for SHOW ENGINE STATUS statement.
Definition: parse_tree_nodes.h:3631
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2762
PT_show_engine_status(const POS &pos, LEX_STRING opt_engine={})
Definition: parse_tree_nodes.h:3633
Sql_cmd_show_engine_status m_sql_cmd
Definition: parse_tree_nodes.h:3639
Parse tree node for SHOW ENGINES statement.
Definition: parse_tree_nodes.h:3644
PT_show_engines(const POS &pos)
Definition: parse_tree_nodes.h:3646
Sql_cmd_show_engines m_sql_cmd
Definition: parse_tree_nodes.h:3652
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2776
Parse tree node for SHOW ERRORS statement.
Definition: parse_tree_nodes.h:3657
PT_limit_clause *const m_opt_limit_clause
Definition: parse_tree_nodes.h:3666
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2785
Sql_cmd_show_errors m_sql_cmd
Definition: parse_tree_nodes.h:3668
PT_show_errors(const POS &pos, PT_limit_clause *opt_limit_clause=nullptr)
Definition: parse_tree_nodes.h:3659
Parse tree node for SHOW EVENTS statement.
Definition: parse_tree_nodes.h:3673
Sql_cmd_show_events m_sql_cmd
Definition: parse_tree_nodes.h:3682
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2819
PT_show_events(const POS &pos, char *opt_db, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3675
Parse tree node for SHOW COLUMNS statement.
Definition: parse_tree_nodes.h:3687
Sql_cmd_show_columns m_sql_cmd
Definition: parse_tree_nodes.h:3701
Show_cmd_type m_show_cmd_type
Definition: parse_tree_nodes.h:3700
PT_show_fields(const POS &pos, Show_cmd_type show_cmd_type, Table_ident *table, LEX_STRING opt_wild={}, Item *opt_where=nullptr)
Definition: parse_tree_nodes.h:3691
PT_show_table_base super
Definition: parse_tree_nodes.h:3688
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2797
Base class for Parse tree nodes of SHOW statements with LIKE/WHERE parameter.
Definition: parse_tree_nodes.h:3304
Item * m_where
Definition: parse_tree_nodes.h:3313
PT_show_filter_base(const POS &pos, enum_sql_command sql_command, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3306
LEX_STRING m_wild
Wild or where clause used in the statement.
Definition: parse_tree_nodes.h:3312
Parse tree node for SHOW FUNCTION CODE statement.
Definition: parse_tree_nodes.h:3706
PT_show_function_code(const POS &pos, const sp_name *function_name)
Definition: parse_tree_nodes.h:3708
Parse tree node for SHOW GRANTS statement.
Definition: parse_tree_nodes.h:3714
Sql_cmd_show_grants sql_cmd
Definition: parse_tree_nodes.h:3726
PT_show_grants(const POS &pos, const LEX_USER *opt_for_user, const List< LEX_USER > *opt_using_users)
Definition: parse_tree_nodes.h:3716
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4709
Parse tree node for SHOW INDEX statement.
Definition: parse_tree_nodes.h:3731
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2811
PT_show_keys(const POS &pos, bool extended_show, Table_ident *table, Item *where)
Definition: parse_tree_nodes.h:3733
Sql_cmd_show_keys m_sql_cmd
Definition: parse_tree_nodes.h:3745
bool m_extended_show
Definition: parse_tree_nodes.h:3744
PT_show_table_base super
Definition: parse_tree_nodes.h:3741
Parse tree node for SHOW OPEN TABLES statement.
Definition: parse_tree_nodes.h:3763
PT_show_open_tables(const POS &pos, char *opt_db, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3765
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2840
Sql_cmd_show_open_tables m_sql_cmd
Definition: parse_tree_nodes.h:3773
Parse tree node for SHOW PARSE_TREE statement.
Definition: parse_tree_nodes.h:3803
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:4714
Parse_tree_root *const m_parse_tree_stmt
Definition: parse_tree_nodes.h:3812
Sql_cmd_show_parse_tree m_sql_cmd
Definition: parse_tree_nodes.h:3813
PT_show_parse_tree(const POS &pos, Parse_tree_root *parse_tree_stmt)
Definition: parse_tree_nodes.h:3805
Parse tree node for SHOW PLUGINS statement.
Definition: parse_tree_nodes.h:3778
Sql_cmd_show_plugins m_sql_cmd
Definition: parse_tree_nodes.h:3785
PT_show_plugins(const POS &pos)
Definition: parse_tree_nodes.h:3780
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2858
Parse tree node for SHOW PRIVILEGES statement.
Definition: parse_tree_nodes.h:3790
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2867
PT_show_privileges(const POS &pos)
Definition: parse_tree_nodes.h:3792
Sql_cmd_show_privileges m_sql_cmd
Definition: parse_tree_nodes.h:3798
Parse tree node for SHOW FUNCTION CODE statement.
Definition: parse_tree_nodes.h:3818
PT_show_procedure_code(const POS &pos, const sp_name *procedure_name)
Definition: parse_tree_nodes.h:3820
Parse tree node for SHOW PROCESSLIST statement.
Definition: parse_tree_nodes.h:3826
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2874
Sql_cmd_show_processlist m_sql_cmd
Definition: parse_tree_nodes.h:3834
PT_show_processlist(const POS &pos, bool verbose)
Definition: parse_tree_nodes.h:3828
Parse tree node for SHOW PROFILE statement.
Definition: parse_tree_nodes.h:3839
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2897
uint m_opt_profile_options
Definition: parse_tree_nodes.h:3852
Sql_cmd_show_profile m_sql_cmd
Definition: parse_tree_nodes.h:3856
PT_show_profile(const POS &pos, uint opt_profile_options=0, my_thread_id opt_query_id=0, PT_limit_clause *opt_limit_clause=nullptr)
Definition: parse_tree_nodes.h:3841
my_thread_id m_opt_query_id
Definition: parse_tree_nodes.h:3853
PT_limit_clause *const m_opt_limit_clause
Definition: parse_tree_nodes.h:3854
Parse tree node for SHOW PROFILES statement.
Definition: parse_tree_nodes.h:3861
PT_show_profiles(const POS &pos)
Definition: parse_tree_nodes.h:3863
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2912
Sql_cmd_show_profiles m_sql_cmd
Definition: parse_tree_nodes.h:3868
Parse tree node for SHOW RELAYLOG EVENTS statement.
Definition: parse_tree_nodes.h:3873
Sql_cmd_show_relaylog_events m_sql_cmd
Definition: parse_tree_nodes.h:3891
PT_show_relaylog_events(const POS &pos, const LEX_STRING opt_log_file_name={}, PT_limit_clause *opt_limit_clause=nullptr, LEX_CSTRING opt_channel_name={})
Definition: parse_tree_nodes.h:3875
PT_limit_clause *const m_opt_limit_clause
Definition: parse_tree_nodes.h:3888
const LEX_STRING m_opt_log_file_name
Definition: parse_tree_nodes.h:3887
const LEX_CSTRING m_opt_channel_name
Definition: parse_tree_nodes.h:3889
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2919
Parse tree node for SHOW REPLICA STATUS statement.
Definition: parse_tree_nodes.h:3908
Sql_cmd_show_replica_status m_sql_cmd
Definition: parse_tree_nodes.h:3919
const LEX_CSTRING m_opt_channel_name
Definition: parse_tree_nodes.h:3917
PT_show_replica_status(const POS &pos, LEX_CSTRING opt_channel_name={})
Definition: parse_tree_nodes.h:3910
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2939
Parse tree node for SHOW REPLICAS statement.
Definition: parse_tree_nodes.h:3896
Sql_cmd_show_replicas m_sql_cmd
Definition: parse_tree_nodes.h:3903
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2932
PT_show_replicas(const POS &pos)
Definition: parse_tree_nodes.h:3898
Parse tree node for SHOW FUNCTION/PROCEDURE CODE statements.
Definition: parse_tree_nodes.h:3353
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2890
Sql_cmd_show_routine_code m_sql_cmd
Definition: parse_tree_nodes.h:3362
PT_show_routine_code(const POS &pos, enum_sql_command sql_command, const sp_name *routine_name)
Definition: parse_tree_nodes.h:3355
Base class for Parse tree nodes of SHOW statements with schema parameter.
Definition: parse_tree_nodes.h:3318
char * m_opt_db
Optional schema name in FROM/IN clause.
Definition: parse_tree_nodes.h:3329
PT_show_schema_base(const POS &pos, enum_sql_command sql_command, char *opt_db, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3320
Item * m_where
Definition: parse_tree_nodes.h:3332
LEX_STRING m_wild
Wild or where clause used in the statement.
Definition: parse_tree_nodes.h:3331
Parse tree node for SHOW STATUS FUNCTION statement.
Definition: parse_tree_nodes.h:3943
Sql_cmd_show_status_func m_sql_cmd
Definition: parse_tree_nodes.h:3951
PT_show_status_func(const POS &pos, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3945
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2964
Parse tree node for SHOW STATUS PROCEDURE statement.
Definition: parse_tree_nodes.h:3956
PT_show_status_proc(const POS &pos, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3958
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2977
Sql_cmd_show_status_proc m_sql_cmd
Definition: parse_tree_nodes.h:3964
Parse tree node for SHOW STATUS statement.
Definition: parse_tree_nodes.h:3924
enum_var_type m_var_type
Definition: parse_tree_nodes.h:3938
Sql_cmd_show_status m_sql_cmd
Definition: parse_tree_nodes.h:3936
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2948
PT_show_status(const POS &pos, enum_var_type var_type, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3926
Base class for Parse tree nodes of SHOW COLUMNS/SHOW INDEX statements.
Definition: parse_tree_nodes.h:3337
bool make_table_base_cmd(THD *thd, bool *temporary)
Definition: parse_tree_nodes.cc:2483
PT_show_table_base(const POS &pos, enum_sql_command sql_command, Table_ident *table_ident, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3339
Table_ident * m_table_ident
Table used in the statement.
Definition: parse_tree_nodes.h:3348
Parse tree node for SHOW TABLE STATUS statement.
Definition: parse_tree_nodes.h:3969
Sql_cmd_show_table_status m_sql_cmd
Definition: parse_tree_nodes.h:3979
PT_show_table_status(const POS &pos, char *opt_db, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3971
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:2990
Parse tree node for SHOW TABLES statement.
Definition: parse_tree_nodes.h:3984
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3005
Show_cmd_type m_show_cmd_type
Definition: parse_tree_nodes.h:3996
PT_show_tables(const POS &pos, Show_cmd_type show_cmd_type, char *opt_db, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:3986
Sql_cmd_show_tables m_sql_cmd
Definition: parse_tree_nodes.h:3994
Parse tree node for SHOW TRIGGERS statement.
Definition: parse_tree_nodes.h:4001
PT_show_triggers(const POS &pos, bool full, char *opt_db, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:4003
bool m_full
Definition: parse_tree_nodes.h:4013
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3021
Sql_cmd_show_triggers m_sql_cmd
Definition: parse_tree_nodes.h:4011
Parse tree node for SHOW VARIABLES statement.
Definition: parse_tree_nodes.h:4018
enum_var_type m_var_type
Definition: parse_tree_nodes.h:4032
Sql_cmd_show_variables m_sql_cmd
Definition: parse_tree_nodes.h:4030
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3036
PT_show_variables(const POS &pos, enum_var_type var_type, const LEX_STRING &wild, Item *where)
Definition: parse_tree_nodes.h:4020
Parse tree node for SHOW WARNINGS statement.
Definition: parse_tree_nodes.h:4037
PT_limit_clause *const m_opt_limit_clause
Definition: parse_tree_nodes.h:4046
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3052
Sql_cmd_show_warnings m_sql_cmd
Definition: parse_tree_nodes.h:4048
PT_show_warnings(const POS &pos, PT_limit_clause *opt_limit_clause=nullptr)
Definition: parse_tree_nodes.h:4039
Top-level node for the SHUTDOWN statement.
Definition: parse_tree_nodes.h:2150
Sql_cmd * make_cmd(THD *) override
Definition: parse_tree_nodes.h:2154
Sql_cmd_shutdown sql_cmd
Definition: parse_tree_nodes.h:2151
Definition: parse_tree_nodes.h:1214
PT_start_option_value_list_following_option_type_eq(const POS &pos, PT_set_scoped_system_variable *head_arg, const POS &head_pos_arg, PT_option_value_list_head *opt_tail_arg)
Definition: parse_tree_nodes.h:1222
POS head_pos
Definition: parse_tree_nodes.h:1218
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4190
PT_start_option_value_list_following_option_type super
Definition: parse_tree_nodes.h:1215
PT_option_value_list_head * opt_tail
Definition: parse_tree_nodes.h:1219
PT_set_scoped_system_variable * head
Definition: parse_tree_nodes.h:1217
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4204
PT_start_option_value_list_following_option_type_transaction(const POS &pos, PT_transaction_characteristics *characteristics_arg, const POS &characteristics_pos_arg)
Definition: parse_tree_nodes.h:1241
PT_transaction_characteristics * characteristics
Definition: parse_tree_nodes.h:1237
PT_start_option_value_list_following_option_type super
Definition: parse_tree_nodes.h:1235
POS characteristics_pos
Definition: parse_tree_nodes.h:1238
Definition: parse_tree_nodes.h:1207
PT_start_option_value_list_following_option_type(const POS &pos)
Definition: parse_tree_nodes.h:1209
Definition: parse_tree_nodes.h:1123
PT_start_option_value_list super
Definition: parse_tree_nodes.h:1124
POS head_pos
Definition: parse_tree_nodes.h:1127
PT_start_option_value_list_no_type(const POS &pos, PT_option_value_no_option_type *head_arg, const POS &head_pos_arg, PT_option_value_list_head *tail_arg)
Definition: parse_tree_nodes.h:1131
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4144
PT_option_value_list_head * tail
Definition: parse_tree_nodes.h:1128
PT_option_value_no_option_type * head
Definition: parse_tree_nodes.h:1126
Definition: parse_tree_nodes.h:1189
PT_transaction_characteristics * characteristics
Definition: parse_tree_nodes.h:1192
PT_start_option_value_list super
Definition: parse_tree_nodes.h:1190
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4175
POS end_pos
Definition: parse_tree_nodes.h:1193
PT_start_option_value_list_transaction(const POS &pos, PT_transaction_characteristics *characteristics_arg, const POS &end_pos_arg)
Definition: parse_tree_nodes.h:1196
Definition: parse_tree_nodes.h:1251
PT_start_option_value_list super
Definition: parse_tree_nodes.h:1252
PT_start_option_value_list_following_option_type * list
Definition: parse_tree_nodes.h:1255
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4216
PT_start_option_value_list_type(const POS &pos, enum_var_type type_arg, PT_start_option_value_list_following_option_type *list_arg)
Definition: parse_tree_nodes.h:1258
enum_var_type type
Definition: parse_tree_nodes.h:1254
Definition: parse_tree_nodes.h:1013
PT_start_option_value_list(const POS &pos)
Definition: parse_tree_nodes.h:1015
Definition: parse_tree_nodes.h:3226
PT_static_privilege(const POS &pos, const POS &errpos, uint grant, const Mem_root_array< LEX_CSTRING > *columns=nullptr)
Definition: parse_tree_nodes.h:3231
const Mem_root_array< LEX_CSTRING > * columns
Definition: parse_tree_nodes.h:3228
const uint grant
Definition: parse_tree_nodes.h:3227
Privilege * get_privilege(THD *thd) override
Definition: parse_tree_nodes.cc:4670
Definition: parse_tree_nodes.h:1781
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4417
Parse_tree_node super
Definition: parse_tree_nodes.h:1782
PT_query_expression_body * qe
Definition: parse_tree_nodes.h:1784
bool m_is_derived_table
Definition: parse_tree_nodes.h:1788
Query_block * value()
Definition: parse_tree_nodes.h:1798
Query_block * query_block
Definition: parse_tree_nodes.h:1785
PT_subquery(const POS &pos, PT_query_expression_body *query_expression)
Definition: parse_tree_nodes.h:1790
Definition: parse_tree_nodes.h:2477
PT_table_constraint_def(const POS &pos)
Definition: parse_tree_nodes.h:2479
Definition: parse_tree_nodes.h:185
~PT_table_ddl_stmt_base() override=0
Alter_info m_alter_info
Definition: parse_tree_nodes.h:193
PT_table_ddl_stmt_base(const POS &pos, MEM_ROOT *mem_root)
Definition: parse_tree_nodes.h:187
Base class for column/constraint definitions in CREATE TABLE.
Definition: parse_tree_nodes.h:2472
PT_table_element(const POS &pos)
Definition: parse_tree_nodes.h:2474
Definition: parse_tree_nodes.h:507
Item * m_path
Definition: parse_tree_nodes.h:524
const LEX_STRING m_table_alias
Definition: parse_tree_nodes.h:526
Item * m_expr
Definition: parse_tree_nodes.h:523
PT_table_reference super
Definition: parse_tree_nodes.h:508
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1356
Mem_root_array< PT_json_table_column * > * m_nested_columns
Definition: parse_tree_nodes.h:525
PT_table_factor_function(const POS &pos, Item *expr, Item *path, Mem_root_array< PT_json_table_column * > *nested_cols, const LEX_STRING &table_alias)
Definition: parse_tree_nodes.h:511
Definition: parse_tree_nodes.h:563
PT_joined_table * m_joined_table
Definition: parse_tree_nodes.h:573
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1466
PT_table_reference super
Definition: parse_tree_nodes.h:564
PT_table_factor_joined_table(const POS &pos, PT_joined_table *joined_table)
Definition: parse_tree_nodes.h:567
Definition: parse_tree_nodes.h:472
const char *const opt_table_alias
Definition: parse_tree_nodes.h:477
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3873
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.cc:3900
Table_ident * table_ident
Definition: parse_tree_nodes.h:475
PT_table_factor_table_ident(const POS &pos, Table_ident *table_ident_arg, List< String > *opt_use_partition_arg, const LEX_CSTRING &opt_table_alias_arg, List< Index_hint > *opt_key_definition_arg, PT_tablesample *opt_tablesample_arg)
Definition: parse_tree_nodes.h:482
PT_table_reference super
Definition: parse_tree_nodes.h:473
List< Index_hint > * opt_key_definition
Definition: parse_tree_nodes.h:478
PT_tablesample * opt_tablesample
Definition: parse_tree_nodes.h:479
List< String > * opt_use_partition
Definition: parse_tree_nodes.h:476
Definition: parse_tree_nodes.h:782
Table_ident_list m_tables
Definition: parse_tree_nodes.h:798
bool raise_error(THD *thd, const Table_ident *name, int error)
Definition: parse_tree_nodes.cc:4027
bool set_lock_for_tables(Parse_context *pc) override
Definition: parse_tree_nodes.cc:2462
PT_table_locking_clause(const POS &pos, Lock_strength strength, Mem_root_array_YY< Table_ident * > tables, Locked_row_action action)
Definition: parse_tree_nodes.h:786
Mem_root_array_YY< Table_ident * > Table_ident_list
Definition: parse_tree_nodes.h:784
Definition: parse_tree_nodes.h:529
PT_table_reference super
Definition: parse_tree_nodes.h:530
PT_table_reference_list_parens(const POS &pos, const Mem_root_array_YY< PT_table_reference * > table_list)
Definition: parse_tree_nodes.h:535
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:3911
Mem_root_array_YY< PT_table_reference * > table_list
Definition: parse_tree_nodes.h:532
Definition: parse_tree_nodes.h:451
PT_table_reference(const POS &pos)
Definition: parse_tree_nodes.h:453
Table_ref * m_table_ref
Definition: parse_tree_nodes.h:455
virtual PT_joined_table * add_cross_join(PT_cross_join *cj)
Lets us build a parse tree top-down, which is necessary due to the context-dependent nature of the jo...
Definition: parse_tree_nodes.cc:161
Definition: parse_tree_nodes.h:1589
PT_insert_values_list *const row_value_list
Definition: parse_tree_nodes.h:1592
bool is_set_operation() const override
Definition: parse_tree_nodes.h:1604
bool has_into_clause() const override
Definition: parse_tree_nodes.h:1601
PT_insert_values_list * get_row_value_list() const override
Definition: parse_tree_nodes.h:1610
bool can_absorb_order_and_limit(bool, bool) const override
True if this query expression can absorb an extraneous order by/limit clause.
Definition: parse_tree_nodes.h:1606
bool has_trailing_into_clause() const override
Definition: parse_tree_nodes.h:1602
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1308
bool is_table_value_constructor() const override
Definition: parse_tree_nodes.h:1608
PT_query_primary super
Definition: parse_tree_nodes.h:1590
PT_table_value_constructor(const POS &pos, PT_insert_values_list *row_value_list_arg)
Definition: parse_tree_nodes.h:1595
Definition: parse_tree_nodes.h:693
PT_tablesample(const POS &pos, tablesample_type tablesample_type_arg, Item *sample_percentage)
Definition: parse_tree_nodes.h:700
Parse_tree_node super
Definition: parse_tree_nodes.h:694
tablesample_type m_sampling_type
Definition: parse_tree_nodes.h:697
Item * m_sample_percentage
Definition: parse_tree_nodes.h:698
A template for options that set HA_CREATE_INFO::table_options and also records if the option was expl...
Definition: parse_tree_nodes.h:2726
PT_create_table_option super
Definition: parse_tree_nodes.h:2727
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:2735
const Ternary_option value
Definition: parse_tree_nodes.h:2729
PT_ternary_create_table_option(const POS &pos, Ternary_option value)
Definition: parse_tree_nodes.h:2732
A template for options that set a single property in HA_CREATE_INFO, and also records if the option w...
Definition: parse_tree_nodes.h:2588
PT_traceable_create_table_option(const POS &pos, Option_type value)
Definition: parse_tree_nodes.h:2594
const Option_type value
Definition: parse_tree_nodes.h:2591
PT_create_table_option super
Definition: parse_tree_nodes.h:2589
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:2597
A template for options that set a single property in a KEY_CREATE_INFO, and also records if the optio...
Definition: parse_tree_nodes.h:2400
bool do_contextualize(Table_ddl_parse_context *pc) override
Definition: parse_tree_nodes.h:2405
Option_type m_option_value
Definition: parse_tree_nodes.h:2412
PT_traceable_index_option(const POS &pos, Option_type option_value)
Definition: parse_tree_nodes.h:2402
Definition: parse_tree_nodes.h:1154
PT_transaction_characteristic super
Definition: parse_tree_nodes.h:1155
PT_transaction_access_mode(const POS &pos, bool is_read_only)
Definition: parse_tree_nodes.h:1158
Definition: parse_tree_nodes.h:1140
int32 value
Definition: parse_tree_nodes.h:1144
Parse_tree_node super
Definition: parse_tree_nodes.h:1141
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:4156
PT_transaction_characteristic(const POS &pos, const char *name_arg, int32 value_arg)
Definition: parse_tree_nodes.h:1147
const char * name
Definition: parse_tree_nodes.h:1143
Definition: parse_tree_nodes.h:1170
PT_transaction_characteristic * opt_tail
Definition: parse_tree_nodes.h:1174
PT_transaction_characteristics(const POS &pos, PT_transaction_characteristic *head_arg, PT_transaction_characteristic *opt_tail_arg)
Definition: parse_tree_nodes.h:1177
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.h:1182
PT_transaction_characteristic * head
Definition: parse_tree_nodes.h:1173
Parse_tree_node super
Definition: parse_tree_nodes.h:1171
Definition: parse_tree_nodes.h:5046
PT_truncate_table_stmt(const POS &pos, Table_ident *table)
Definition: parse_tree_nodes.h:5048
Sql_cmd_truncate_table m_cmd_truncate_table
Definition: parse_tree_nodes.h:5056
Table_ident * m_table
Definition: parse_tree_nodes.h:5054
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:3392
Base class for all column type nodes.
Definition: parse_tree_column_attrs.h:556
Definition: parse_tree_nodes.h:1853
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:1808
enum Setop_type type() const override
Definition: parse_tree_nodes.h:1859
PT_set_operation(const POS &pos, PT_query_expression_body *lhs, bool is_distinct, PT_query_expression_body *rhs, bool is_rhs_in_parentheses=false)
Definition: parse_tree_nodes.h:1805
Top-level node for the UPDATE statement.
Definition: parse_tree_nodes.h:2006
PT_with_clause * m_with_clause
Definition: parse_tree_nodes.h:2009
Item * opt_limit_clause
Definition: parse_tree_nodes.h:2018
PT_update(const POS &pos, PT_with_clause *with_clause_arg, PT_hint_list *opt_hints_arg, thr_lock_type opt_low_priority_arg, bool opt_ignore_arg, const Mem_root_array_YY< PT_table_reference * > &join_table_list_arg, PT_item_list *column_list_arg, PT_item_list *value_list_arg, Item *opt_where_clause_arg, PT_order *opt_order_clause_arg, Item *opt_limit_clause_arg)
Definition: parse_tree_nodes.h:2021
Sql_cmd * make_cmd(THD *thd) override
Definition: parse_tree_nodes.cc:976
Mem_root_array_YY< PT_table_reference * > join_table_list
Definition: parse_tree_nodes.h:2013
PT_hint_list * opt_hints
Definition: parse_tree_nodes.h:2010
bool opt_ignore
Definition: parse_tree_nodes.h:2012
PT_item_list * value_list
Definition: parse_tree_nodes.h:2015
thr_lock_type opt_low_priority
Definition: parse_tree_nodes.h:2011
PT_item_list * column_list
Definition: parse_tree_nodes.h:2014
Parse_tree_root super
Definition: parse_tree_nodes.h:2007
PT_order * opt_order_clause
Definition: parse_tree_nodes.h:2017
Item * opt_where_clause
Definition: parse_tree_nodes.h:2016
Parse tree node for a list of window definitions corresponding to a <window clause> in SQL 2003.
Definition: parse_tree_window.h:63
Represents the WITH clause: WITH [...], [...] SELECT ..., ^^^^^^^^^^^^^^^^^.
Definition: parse_tree_nodes.h:366
const Table_ref * m_most_inner_in_parsing
The innermost CTE reference which we're parsing at the moment.
Definition: parse_tree_nodes.h:415
void print(const THD *thd, String *str, enum_query_type query_type)
Definition: parse_tree_nodes.cc:2088
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_nodes.cc:2077
void leave_parsing_definition(const Table_ref *old)
Definition: parse_tree_nodes.h:396
Parse_tree_node super
Definition: parse_tree_nodes.h:367
PT_with_clause(const POS &pos, const PT_with_list *l, bool r)
Definition: parse_tree_nodes.h:370
void add_json_info(Json_object *obj) override
Add all the node-specific json fields.
Definition: parse_tree_nodes.h:402
const PT_with_list *const m_list
All CTEs of this clause.
Definition: parse_tree_nodes.h:408
const Table_ref * enter_parsing_definition(Table_ref *tl)
Call this to record in the WITH clause that we are contextualizing the CTE definition inserted in tab...
Definition: parse_tree_nodes.h:391
const bool m_recursive
True if the user has specified the RECURSIVE keyword.
Definition: parse_tree_nodes.h:410
Represents the WITH list.
Definition: parse_tree_nodes.h:344
Mem_root_array< PT_common_table_expr * > m_elements
Definition: parse_tree_nodes.h:358
Parse_tree_node super
Definition: parse_tree_nodes.h:345
bool push_back(PT_common_table_expr *el)
Definition: parse_tree_nodes.cc:2026
PT_with_list(const POS &pos, MEM_ROOT *mem_root)
Definition: parse_tree_nodes.h:350
const Mem_root_array< PT_common_table_expr * > & elements() const
Definition: parse_tree_nodes.h:353
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:231
virtual bool contextualize(Context *pc) final
Definition: parse_tree_node_base.h:319
bool is_contextualized() const
Definition: parse_tree_node_base.h:309
void error(Context *pc, const POS &pos) const
syntax_error() function replacement for deferred reporting of syntax errors
Definition: parse_tree_node_base.h:344
virtual bool do_contextualize(Context *pc)
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_node_base.h:283
Base class for all top-level nodes of SQL statements.
Definition: parse_tree_nodes.h:162
Parse_tree_root()=default
void operator=(const Parse_tree_root &)=delete
Parse_tree_root(const Parse_tree_root &)=delete
virtual ~Parse_tree_root()=default
Parse_tree_root(const POS &pos)
Definition: parse_tree_nodes.h:168
virtual std::string get_printable_parse_tree(THD *thd)
Definition: parse_tree_nodes.h:178
POS m_pos
Textual location of a token just parsed.
Definition: parse_tree_nodes.h:173
virtual Sql_cmd * make_cmd(THD *thd)=0
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1167
bool clear_correlated_query_blocks()
Empties all correlated query blocks defined within the query expression; that is, correlated CTEs def...
Definition: sql_union.cc:1640
Common base class for n-ary set operations, including unary.
Definition: query_term.h:402
Simple intrusive linked list.
Definition: sql_list.h:47
Class to represent the check constraint specifications obtained from the SQL statement parse.
Definition: sql_check_constraint.h:43
Item * check_expr
Check constraint expression.
Definition: sql_check_constraint.h:80
LEX_STRING column_name
Name of the column if check clause is defined at the column level.
Definition: sql_check_constraint.h:83
bool is_enforced
Check constraint state (enforced/not enforced)
Definition: sql_check_constraint.h:86
LEX_STRING name
Name of the check constraint.
Definition: sql_check_constraint.h:77
Definition: sql_admin.h:409
Class that represents the ALTER TABLE t1 ANALYZE PARTITION p statement.
Definition: sql_partition_admin.h:53
Class that represents the ALTER TABLE t1 CHECK PARTITION p statement.
Definition: sql_partition_admin.h:75
Class that represents the ALTER TABLE t1 EXCHANGE PARTITION p WITH TABLE t2 statement.
Definition: sql_partition_admin.h:39
Class that represents the ALTER TABLE t1 OPTIMIZE PARTITION p statement.
Definition: sql_partition_admin.h:91
Class that represents the ALTER TABLE t1 REPAIR PARTITION p statement.
Definition: sql_partition_admin.h:106
Class that represents the ALTER TABLE t1 TRUNCATE PARTITION p statement.
Definition: sql_partition_admin.h:121
Represents the generic ALTER TABLE statement.
Definition: sql_alter.h:617
Sql_cmd_alter_user_default_role ALTER USER ... DEFAULT ROLE ... statement.
Definition: sql_admin.h:368
Histogram_command
Specifies which (if any) of the commands UPDATE HISTOGRAM or DROP HISTOGRAM that is specified after A...
Definition: sql_admin.h:71
Sql_cmd_create_role represents the CREATE ROLE ... statement.
Definition: sql_admin.h:288
Definition: sql_cmd_srs.h:56
Represents ALTER TABLE IMPORT/DISCARD TABLESPACE statements.
Definition: sql_alter.h:628
Sql_cmd_drop_role represents the DROP ROLE ... statement.
Definition: sql_admin.h:308
Definition: sql_cmd_srs.h:110
Definition: opt_explain.h:204
Definition: sql_load.h:49
Sql_cmd_restart_server represents the RESTART server statement.
Definition: sql_restart_server.h:41
Represents ALTER TABLE SECONDARY_LOAD/SECONDARY_UNLOAD statements.
Definition: sql_alter.h:641
Sql_cmd_set_role represents the SET ROLE ... statement.
Definition: sql_admin.h:260
Represents SHOW BINARY LOG STATUS statement.
Definition: sql_show.h:442
Following are all subclasses of class Sql_cmd_show, in alphabetical order.
Definition: sql_show.h:236
Represents SHOW BINARY LOGS statement.
Definition: sql_show.h:251
Represents SHOW CHARACTER SET statement.
Definition: sql_show.h:260
Represents SHOW COLLATION statement.
Definition: sql_show.h:267
Represents SHOW COLUMNS statement.
Definition: sql_show.h:274
Represents SHOW CREATE DATABASE statement.
Definition: sql_show.h:281
Represents SHOW CREATE EVENT statement.
Definition: sql_show.h:290
Represents SHOW CREATE FUNCTION statement.
Definition: sql_show.h:299
Represents SHOW CREATE PROCEDURE statement.
Definition: sql_show.h:309
Represents SHOW CREATE TABLE/VIEW statement.
Definition: sql_show.h:319
Represents SHOW CREATE TRIGGER statement.
Definition: sql_show.h:335
Represents SHOW CREATE USER statement.
Definition: sql_show.h:345
Represents SHOW DATABASES statement.
Definition: sql_show.h:354
Represents SHOW ENGINE LOGS statement.
Definition: sql_show.h:362
Represents SHOW ENGINE MUTEX statement.
Definition: sql_show.h:371
Represents SHOW ENGINE STATUS statement.
Definition: sql_show.h:380
Represents SHOW STORAGE ENGINES statement.
Definition: sql_show.h:390
Represents SHOW ERRORS statement.
Definition: sql_show.h:397
Represents SHOW EVENTS statement.
Definition: sql_show.h:407
Represents SHOW GRANTS statement.
Definition: sql_show.h:417
Represents the SHOW INDEX statement.
Definition: sql_show.h:435
Represents SHOW OPEN TABLES statement.
Definition: sql_show.h:452
Represents SHOW PARSE_TREE statement.
Definition: sql_show.h:494
Represents SHOW PLUGINS statement.
Definition: sql_show.h:459
Represents SHOW PRIVILEGES statement.
Definition: sql_show.h:466
Represents SHOW PROCESSLIST statement.
Definition: sql_show.h:474
Represents SHOW PROFILE statement.
Definition: sql_show.h:501
Represents SHOW PROFILES statement.
Definition: sql_show.h:508
Represents SHOW RELAYLOG EVENTS statement.
Definition: sql_show.h:516
Represents SHOW REPLICA STATUS statement.
Definition: sql_show.h:540
Represents SHOW REPLICAS statement.
Definition: sql_show.h:531
Represents SHOW FUNCTION CODE and SHOW PROCEDURE CODE statements.
Definition: sql_show.h:220
Represents SHOW STATUS FUNCTION statement.
Definition: sql_show.h:558
Represents SHOW STATUS PROCEDURE statement.
Definition: sql_show.h:565
Represents SHOW STATUS statement.
Definition: sql_show.h:550
Represents SHOW TABLE STATUS statement.
Definition: sql_show.h:572
Represents SHOW TABLES statement.
Definition: sql_show.h:580
Represents SHOW TRIGGERS statement.
Definition: sql_show.h:587
Represents SHOW VARIABLES statement.
Definition: sql_show.h:594
Represents SHOW WARNINGS statement.
Definition: sql_show.h:601
Sql_cmd_shutdown represents the SHUTDOWN statement.
Definition: sql_admin.h:249
Sql_cmd_truncate_table represents the TRUNCATE statement.
Definition: sql_truncate.h:44
Representation of an SQL command.
Definition: sql_cmd.h:83
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
LEX * lex
Definition: sql_class.h:1001
Definition: sql_lex.h:296
Definition: table.h:2865
Represents the (explicit) window of a SQL 2003 section 7.11 <window clause>, or the implicit (inlined...
Definition: window.h:110
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
Definition: partition_info.h:209
uint num_parts
Definition: partition_info.h:370
Sql_cmd_alter_resource_group represents ALTER RESOURCE GROUP statement.
Definition: resource_group_sql_cmd.h:77
Sql_cmd_create_resource_group represents CREATE RESOURCE GROUP statement.
Definition: resource_group_sql_cmd.h:46
Sql_cmd_drop_resource_group represents DROP RESOURCE GROUP statement.
Definition: resource_group_sql_cmd.h:111
Sql_cmd_set_resource_group represents SET RESOURCE GROUP statement.
Definition: resource_group_sql_cmd.h:133
sp_head represents one instance of a stored program.
Definition: sp_head.h:383
Definition: sp_head.h:123
Used to hold information about file and file structure in exchange via non-DB file (....
Definition: sql_exchange.h:79
Field_separators field
Definition: sql_exchange.h:81
const CHARSET_INFO * cs
Definition: sql_exchange.h:87
Line_separators line
Definition: sql_exchange.h:82
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
enum_query_type
Query type constants (usable as bitmap flags).
Definition: enum_query_type.h:31
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:216
bool make_subquery_node(THD *thd, PT_subquery **node)
Definition: sql_parse.cc:5743
bool lookup(Table_ref *tl, PT_common_table_expr **found)
Looks up a table reference into the list of CTEs.
Definition: sql_parse.cc:5844
bool match_table_ref(Table_ref *tl, bool in_self, bool *found)
Definition: sql_parse.cc:5925
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::avg_row_length), HA_CREATE_USED_AVG_ROW_LENGTH > PT_create_avg_row_length_option
Node for the AVG_ROW_LENGTH_ROWS [=] <integer> table option.
Definition: parse_tree_nodes.h:2632
PT_ternary_create_table_option< HA_CREATE_USED_PACK_KEYS, 0, HA_OPTION_PACK_KEYS, HA_OPTION_NO_PACK_KEYS > PT_create_pack_keys_option
Node for the PACK_KEYS [=] 1|0|DEFAULT table option.
Definition: parse_tree_nodes.h:2770
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::auto_increment_value), HA_CREATE_USED_AUTO > PT_create_auto_increment_option
Node for the AUTO_INCREMENT [=] <integer> table option.
Definition: parse_tree_nodes.h:2677
PT_bool_create_table_option< HA_CREATE_USED_CHECKSUM, HA_OPTION_CHECKSUM, HA_OPTION_NO_CHECKSUM > PT_create_checksum_option
Node for the CHECKSUM|TABLE_CHECKSUM [=] 0|<not 0> table option.
Definition: parse_tree_nodes.h:2826
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::compress), HA_CREATE_USED_COMPRESS > PT_create_compress_option
Node for the COMPRESSION [=] <string> table option.
Definition: parse_tree_nodes.h:2659
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::encrypt_type), HA_CREATE_USED_ENCRYPT > PT_create_encryption_option
Node for the ENGRYPTION [=] <string> table option.
Definition: parse_tree_nodes.h:2668
PT_ternary_create_table_option< HA_CREATE_USED_STATS_PERSISTENT, 0, HA_OPTION_STATS_PERSISTENT, HA_OPTION_NO_STATS_PERSISTENT > PT_create_stats_persistent_option
Node for the STATS_PERSISTENT [=] 1|0|DEFAULT table option.
Definition: parse_tree_nodes.h:2787
PT_bool_create_table_option< HA_CREATE_USED_DELAY_KEY_WRITE, HA_OPTION_DELAY_KEY_WRITE, HA_OPTION_NO_DELAY_KEY_WRITE > PT_create_delay_key_write_option
Node for the DELAY_KEY_WRITE [=] 0|<not 0> table option.
Definition: parse_tree_nodes.h:2841
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::comment), HA_CREATE_USED_COMMENT > PT_create_commen_option
Node for the COMMENT [=] <string> table option.
Definition: parse_tree_nodes.h:2650
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::max_rows), HA_CREATE_USED_MAX_ROWS > PT_create_max_rows_option
Node for the MAX_ROWS [=] <integer> table option.
Definition: parse_tree_nodes.h:2614
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::min_rows), HA_CREATE_USED_MIN_ROWS > PT_create_min_rows_option
Node for the MIN_ROWS [=] <integer> table option.
Definition: parse_tree_nodes.h:2623
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::password), HA_CREATE_USED_PASSWORD > PT_create_password_option
Node for the PASSWORD [=] <string> table option.
Definition: parse_tree_nodes.h:2641
static int flags[50]
Definition: hp_test1.cc:40
static void start(mysql_harness::PluginFuncEnv *env)
Definition: http_auth_backend_plugin.cc:180
fk_match_opt
Definition: key_spec.h:58
enum_order
Definition: key_spec.h:65
@ ORDER_NOT_RELEVANT
Definition: key_spec.h:65
@ ORDER_ASC
Definition: key_spec.h:65
@ ORDER_DESC
Definition: key_spec.h:65
keytype
Definition: key_spec.h:40
fk_option
Definition: key_spec.h:49
constexpr const LEX_STRING NULL_STR
Definition: lex_string.h:46
#define comment
Definition: lexyy.cc:959
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
std::unique_ptr< T, Destroy_only< T > > unique_ptr_destroy_only
std::unique_ptr, but only destroying.
Definition: my_alloc.h:477
This file includes constants used by all storage engines.
#define HA_OPTION_NO_DELAY_KEY_WRITE
DELAY_KEY_WRITE=0 option was specified.
Definition: my_base.h:720
#define HA_OPTION_NO_PACK_KEYS
PACK_KEYS=0 option was specified.
Definition: my_base.h:663
#define HA_OPTION_CHECKSUM
CHECKSUM=1 option was specified.
Definition: my_base.h:648
#define HA_OPTION_NO_CHECKSUM
CHECKSUM=0 option was specified.
Definition: my_base.h:715
#define HA_OPTION_DELAY_KEY_WRITE
DELAY_KEY_WRITE=1 option was specified.
Definition: my_base.h:656
ha_key_alg
Definition: my_base.h:98
#define HA_OPTION_STATS_PERSISTENT
STATS_PERSISTENT=1 has been specified in the SQL command (either CREATE or ALTER TABLE).
Definition: my_base.h:688
ha_storage_media
Definition: my_base.h:116
#define HA_OPTION_PACK_KEYS
PACK_KEYS=1 option was specified.
Definition: my_base.h:616
#define HA_OPTION_NO_STATS_PERSISTENT
STATS_PERSISTENT=0 has been specified in CREATE/ALTER TABLE.
Definition: my_base.h:695
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
unsigned char uchar
Definition: my_inttypes.h:52
#define MYF(v)
Definition: my_inttypes.h:97
int32_t int32
Definition: my_inttypes.h:66
enum_sql_command
Definition: my_sqlcommand.h:46
@ SQLCOM_SHOW_ENGINE_LOGS
Definition: my_sqlcommand.h:64
@ SQLCOM_SHOW_GRANTS
Definition: my_sqlcommand.h:70
@ SQLCOM_SHOW_CREATE_DB
Definition: my_sqlcommand.h:74
@ SQLCOM_SHOW_STATUS_FUNC
Definition: my_sqlcommand.h:145
@ SQLCOM_SHOW_CREATE_FUNC
Definition: my_sqlcommand.h:143
@ SQLCOM_SHOW_CREATE_TRIGGER
Definition: my_sqlcommand.h:174
@ SQLCOM_SHOW_ENGINE_MUTEX
Definition: my_sqlcommand.h:66
@ SQLCOM_SHOW_PARSE_TREE
Definition: my_sqlcommand.h:206
@ SQLCOM_SHOW_PRIVILEGES
Definition: my_sqlcommand.h:129
@ SQLCOM_SHOW_BINLOGS
Definition: my_sqlcommand.h:115
@ SQLCOM_SHOW_BINLOG_EVENTS
Definition: my_sqlcommand.h:123
@ SQLCOM_SHOW_REPLICAS
Definition: my_sqlcommand.h:120
@ SQLCOM_SHOW_WARNS
Definition: my_sqlcommand.h:125
@ SQLCOM_SHOW_STATUS_PROC
Definition: my_sqlcommand.h:144
@ SQLCOM_SHOW_PLUGINS
Definition: my_sqlcommand.h:165
@ SQLCOM_SHOW_PROFILE
Definition: my_sqlcommand.h:175
@ SQLCOM_SHOW_DATABASES
Definition: my_sqlcommand.h:58
@ SQLCOM_SHOW_CHARSETS
Definition: my_sqlcommand.h:72
@ SQLCOM_SHOW_OPEN_TABLES
Definition: my_sqlcommand.h:116
@ SQLCOM_SHOW_TABLE_STATUS
Definition: my_sqlcommand.h:75
@ SQLCOM_SELECT
Definition: my_sqlcommand.h:47
@ SQLCOM_SHOW_ERRORS
Definition: my_sqlcommand.h:127
@ SQLCOM_SHOW_REPLICA_STATUS
Definition: my_sqlcommand.h:69
@ SQLCOM_SHOW_FIELDS
Definition: my_sqlcommand.h:60
@ SQLCOM_SHOW_CREATE_USER
Definition: my_sqlcommand.h:183
@ SQLCOM_SHOW_STATUS
Definition: my_sqlcommand.h:63
@ SQLCOM_SHOW_BINLOG_STATUS
Definition: my_sqlcommand.h:68
@ SQLCOM_SHOW_ENGINE_STATUS
Definition: my_sqlcommand.h:65
@ SQLCOM_SHOW_EVENTS
Definition: my_sqlcommand.h:173
@ SQLCOM_SHOW_CREATE_PROC
Definition: my_sqlcommand.h:142
@ SQLCOM_SHOW_COLLATIONS
Definition: my_sqlcommand.h:73
@ SQLCOM_SHOW_PROC_CODE
Definition: my_sqlcommand.h:159
@ SQLCOM_SHOW_FUNC_CODE
Definition: my_sqlcommand.h:160
@ SQLCOM_SHOW_KEYS
Definition: my_sqlcommand.h:61
@ SQLCOM_SHOW_TABLES
Definition: my_sqlcommand.h:59
@ SQLCOM_SHOW_VARIABLES
Definition: my_sqlcommand.h:62
@ SQLCOM_SHOW_CREATE_EVENT
Definition: my_sqlcommand.h:172
@ SQLCOM_SHOW_PROCESSLIST
Definition: my_sqlcommand.h:67
@ SQLCOM_SHOW_RELAYLOG_EVENTS
Definition: my_sqlcommand.h:179
@ SQLCOM_SHOW_STORAGE_ENGINES
Definition: my_sqlcommand.h:128
@ SQLCOM_SHOW_TRIGGERS
Definition: my_sqlcommand.h:76
@ SQLCOM_SHOW_CREATE
Definition: my_sqlcommand.h:71
@ SQLCOM_SHOW_PROFILES
Definition: my_sqlcommand.h:176
Common header for many mysys elements.
static my_thread_id thread_id
Definition: my_thr_init.cc:63
uint32 my_thread_id
Definition: my_thread_local.h:34
Interface for low level time utilities.
interval_type
Available interval types used in any statement.
Definition: my_time.h:455
@ INTERVAL_LAST
Definition: my_time.h:476
static bool column_names
Definition: mysql.cc:173
char * user
Definition: mysqladmin.cc:66
static bool ignore_errors
Definition: mysqlcheck.cc:62
static uint verbose
Definition: mysqlcheck.cc:66
static char * path
Definition: mysqldump.cc:149
static char * where
Definition: mysqldump.cc:152
static longlong opt_ignore_lines
Definition: mysqlimport.cc:85
static Secondary_engine * secondary_engine
Definition: mysqltest.cc:256
static char * opt_db
Definition: mysqltest.cc:196
const char * collation
Definition: audit_api_message_emit.cc:184
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1086
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
const std::string charset("charset")
std::string dir
Double write files location.
Definition: buf0dblwr.cc:77
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
static std::string lower(std::string_view str)
Definition: config_parser.cc:65
Definition: options.cc:57
Type
Definition: resource_group_basic_types.h:33
const char * table_name
Definition: rules_table_service.cc:56
Cursor end()
A past-the-end Cursor.
Definition: rules_table_service.cc:192
olap_type
Definition: olap.h:31
@ ROLLUP_TYPE
Definition: olap.h:31
EXPLAIN <command>.
Surrounding_context
Definition: parse_tree_node_base.h:101
bool contextualize_nodes(Mem_root_array_YY< Node_type * > nodes, Parse_context_type *pc)
Calls contextualize() on every node in the array.
Definition: parse_tree_nodes.h:150
PT_base_index_option * make_index_secondary_engine_attribute(MEM_ROOT *, LEX_CSTRING)
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided ...
Definition: parse_tree_nodes.cc:5137
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::row_type), HA_CREATE_USED_ROW_FORMAT > PT_create_row_format_option
Definition: parse_tree_nodes.h:2681
#define TYPE_AND_REF(x)
Definition: parse_tree_nodes.h:2605
Parse_tree_node_tmpl< Table_ddl_parse_context > Table_ddl_node
Base class for all table DDL (ALTER TABLE and CREATE TABLE) nodes.
Definition: parse_tree_nodes.h:214
decltype(HA_CREATE_INFO::table_options) table_options_t
Definition: parse_tree_nodes.h:2718
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::data_file_name), HA_CREATE_USED_DATADIR > PT_create_data_directory_option
Definition: parse_tree_nodes.h:2690
PT_index_option< ulong, &KEY_CREATE_INFO::block_size > PT_block_size
Definition: parse_tree_nodes.h:2416
PT_alter_tablespace_option_base * make_tablespace_engine_attribute(MEM_ROOT *, LEX_CSTRING)
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided ...
Definition: parse_tree_nodes.cc:4991
PT_index_option< LEX_CSTRING, &KEY_CREATE_INFO::comment > PT_index_comment
Definition: parse_tree_nodes.h:2418
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::connect_string), HA_CREATE_USED_CONNECTION > PT_create_connection_option
Definition: parse_tree_nodes.h:2702
Mem_root_array_YY< PT_base_index_option * > Index_options
Definition: parse_tree_nodes.h:2415
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::tablespace), HA_CREATE_USED_TABLESPACE > PT_create_tablespace_option
Definition: parse_tree_nodes.h:2698
PT_base_index_option * make_index_engine_attribute(MEM_ROOT *, LEX_CSTRING)
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided ...
Definition: parse_tree_nodes.cc:5117
To * setop_cast(PT_query_expression_body *from, bool is_distinct)
Helper function to imitate dynamic_cast for PT_set_operation hierarchy.
Definition: parse_tree_nodes.h:5596
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::index_file_name), HA_CREATE_USED_INDEXDIR > PT_create_index_directory_option
Definition: parse_tree_nodes.h:2694
PT_index_option< LEX_CSTRING, &KEY_CREATE_INFO::parser_name > PT_fulltext_index_parser_name
Definition: parse_tree_nodes.h:2420
PT_column_attr_base * make_column_engine_attribute(MEM_ROOT *, LEX_CSTRING)
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided ...
Definition: parse_tree_nodes.cc:5058
PT_create_table_option * make_table_engine_attribute(MEM_ROOT *, LEX_CSTRING)
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided ...
Definition: parse_tree_nodes.cc:5012
Parse_tree_node_tmpl< Alter_tablespace_parse_context > PT_alter_tablespace_option_base
Definition: parse_tree_nodes.h:5242
PT_traceable_index_option< ha_key_alg, &KEY_CREATE_INFO::algorithm, &KEY_CREATE_INFO::is_algorithm_explicit > PT_index_type
The data structure (B-tree, Hash, etc) used for an index is called 'index_type' in the manual.
Definition: parse_tree_nodes.h:2433
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::m_implicit_tablespace_autoextend_size), HA_CREATE_USED_AUTOEXTEND_SIZE > PT_create_ts_autoextend_size_option
Definition: parse_tree_nodes.h:2716
PT_set_operation * flatten_equal_set_ops(MEM_ROOT *mem_root, const POS &pos, PT_query_expression_body *left, bool is_distinct, PT_query_expression_body *right, bool is_right_in_parentheses)
Flatten set operators at parse time.
Definition: parse_tree_nodes.h:5626
PT_column_attr_base * make_column_secondary_engine_attribute(MEM_ROOT *, LEX_CSTRING)
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided ...
Definition: parse_tree_nodes.cc:5088
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::key_block_size), HA_CREATE_USED_KEY_BLOCK_SIZE > PT_create_key_block_size_option
Definition: parse_tree_nodes.h:2706
PT_create_table_option * make_table_secondary_engine_attribute(MEM_ROOT *, LEX_CSTRING)
Factory function which instantiates PT_attribute with suitable parameters, allocates on the provided ...
Definition: parse_tree_nodes.cc:5035
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::m_transactional_ddl), HA_CREATE_USED_START_TRANSACTION > PT_create_start_transaction_option
Definition: parse_tree_nodes.h:2711
PT_index_option< bool, &KEY_CREATE_INFO::is_visible > PT_index_visibility
Definition: parse_tree_nodes.h:2421
PT_traceable_create_table_option< TYPE_AND_REF(HA_CREATE_INFO::merge_insert_method), HA_CREATE_USED_INSERT_METHOD > PT_create_insert_method_option
Definition: parse_tree_nodes.h:2686
On_duplicate
Definition: parser_yystype.h:243
Locked_row_action
We will static_cast this one to thr_lock_type.
Definition: parser_yystype.h:214
Lock_strength
Definition: parser_yystype.h:211
PT_joined_table_type
Internally there is no CROSS JOIN join type, as cross joins are just a special case of inner joins wi...
Definition: parser_yystype.h:226
@ JTT_LEFT
Definition: parser_yystype.h:230
@ JTT_STRAIGHT_INNER
Definition: parser_yystype.h:233
@ JTT_NATURAL_LEFT
Definition: parser_yystype.h:235
@ JTT_NATURAL
Definition: parser_yystype.h:229
@ JTT_NATURAL_INNER
Definition: parser_yystype.h:234
@ JTT_NATURAL_RIGHT
Definition: parser_yystype.h:236
@ JTT_STRAIGHT
Definition: parser_yystype.h:228
@ JTT_RIGHT
Definition: parser_yystype.h:231
@ JTT_INNER
Definition: parser_yystype.h:227
Show_cmd_type
Definition: parser_yystype.h:261
Ternary_option
Definition: parser_yystype.h:241
const char * filename
Definition: pfs_example_component_population.cc:67
const mysql_service_registry_t * r
Definition: pfs_example_plugin_employee.cc:86
Query_term_type
This class hierarchy is used to represent SQL structures between <query expression> and <query specif...
Definition: query_term.h:89
required string type
Definition: replication_group_member_actions.proto:34
repeated Action action
Definition: replication_group_member_actions.proto:43
required bool enabled
Definition: replication_group_member_actions.proto:33
"public" interface to sys_var - server configuration variables.
enum_var_type
Definition: set_var.h:91
@ OPT_GLOBAL
Definition: set_var.h:94
@ OPT_SESSION
Definition: set_var.h:93
#define HA_CREATE_USED_COMPRESS
COMPRESSION="zlib|lz4|none" used during table create.
Definition: handler.h:769
#define HA_CREATE_USED_CONNECTION
Definition: handler.h:736
#define HA_CREATE_USED_INSERT_METHOD
Definition: handler.h:721
#define HA_CREATE_USED_PACK_KEYS
Definition: handler.h:725
#define HA_CREATE_USED_DATADIR
Definition: handler.h:728
#define HA_CREATE_USED_KEY_BLOCK_SIZE
Definition: handler.h:737
#define HA_CREATE_USED_INDEXDIR
Definition: handler.h:729
constexpr const uint64_t HA_CREATE_USED_AUTOEXTEND_SIZE
These flags convey that the options AUTOEXTEND_SIZE has been specified in the CREATE TABLE statement.
Definition: handler.h:811
#define HA_CREATE_USED_TABLESPACE
This is set whenever a 'TABLESPACE=...' phrase is used on CREATE TABLE.
Definition: handler.h:766
enum_tx_isolation
Definition: handler.h:3186
#define HA_CREATE_USED_ROW_FORMAT
Definition: handler.h:733
#define HA_CREATE_USED_ENCRYPT
ENCRYPTION="Y" used during table create.
Definition: handler.h:772
#define HA_CREATE_USED_DELAY_KEY_WRITE
Definition: handler.h:732
#define HA_CREATE_USED_MIN_ROWS
Definition: handler.h:722
#define HA_CREATE_USED_PASSWORD
Definition: handler.h:735
constexpr const uint64_t HA_CREATE_USED_START_TRANSACTION
This option is used to convey that the create table should not commit the operation and keep the tran...
Definition: handler.h:795
#define HA_CREATE_USED_COMMENT
Definition: handler.h:734
#define HA_CREATE_USED_MAX_ROWS
Definition: handler.h:723
#define HA_CREATE_USED_CHECKSUM
Definition: handler.h:731
#define HA_CREATE_USED_STATS_PERSISTENT
This is set whenever STATS_PERSISTENT=0|1|default has been specified in CREATE/ALTER TABLE.
Definition: handler.h:747
#define HA_CREATE_USED_AVG_ROW_LENGTH
Definition: handler.h:724
#define HA_CREATE_USED_AUTO
Definition: handler.h:718
alter_instance_action_enum
Definition: sql_admin.h:392
role_enum
Definition: sql_admin.h:255
This file declares the interface of classes Sql_cmd_create_srs and Sql_cmd_drop_srs,...
constexpr const long STACK_MIN_SIZE
Stack reservation.
Definition: sql_const.h:142
enum_filetype
Definition: sql_exchange.h:32
enum_source_type
Definition: sql_exchange.h:30
case opt name
Definition: sslopt-case.h:29
#define STRING_WITH_LEN(X)
Definition: string_with_len.h:29
Definition: parse_tree_nodes.h:5233
Alter_tablespace_parse_context(THD *thd, bool show_parse_tree=false)
Definition: parse_tree_nodes.cc:4888
THD *const thd
Definition: parse_tree_nodes.h:5234
MEM_ROOT *const mem_root
Definition: parse_tree_nodes.h:5235
Definition: m_ctype.h:423
Definition: parse_tree_nodes.h:3183
const LEX_STRING ident
Definition: parse_tree_nodes.h:3184
Dynamic_privilege(const LEX_STRING &ident, const Mem_root_array< LEX_CSTRING > *columns_arg)
Definition: parse_tree_nodes.h:3186
Helper for the sql_exchange class.
Definition: sql_exchange.h:53
void merge_field_separators(const Field_separators &s)
Definition: sql_exchange.h:63
uint sql_flags
Definition: handler.h:3793
uint flags
Definition: handler.h:3792
Struct to hold information about the table that should be created.
Definition: handler.h:3202
ulonglong auto_increment_value
Definition: handler.h:3241
bool m_transactional_ddl
Definition: handler.h:3279
enum row_type row_type
Row type of the table definition.
Definition: handler.h:3262
LEX_STRING compress
Algorithm (and possible options) to be used for InnoDB's transparent page compression.
Definition: handler.h:3218
LEX_STRING encrypt_type
This attribute is used for InnoDB's transparent page encryption.
Definition: handler.h:3226
ulong avg_row_length
Definition: handler.h:3243
const char * data_file_name
Definition: handler.h:3236
ulonglong m_implicit_tablespace_autoextend_size
Definition: handler.h:3284
ulong table_options
Definition: handler.h:3242
uint stats_sample_pages
Definition: handler.h:3248
uint merge_insert_method
Definition: handler.h:3265
LEX_STRING connect_string
Definition: handler.h:3206
const char * tablespace
Definition: handler.h:3208
ulonglong max_rows
Definition: handler.h:3239
const char * password
Definition: handler.h:3207
ha_storage_media storage_media
Definition: handler.h:3266
LEX_STRING comment
Definition: handler.h:3209
const char * index_file_name
Definition: handler.h:3237
std::uint32_t key_block_size
Definition: handler.h:3247
ulonglong min_rows
Definition: handler.h:3240
uint64_t used_fields
Definition: handler.h:3244
Definition: table.h:2732
Opt_hints_global * opt_hints_global
Definition: sql_lex.h:3924
Definition: parser_yystype.h:189
bool is_offset_first
Definition: parser_yystype.h:195
Helper for the sql_exchange class.
Definition: sql_exchange.h:38
void merge_line_separators(const Line_separators &s)
Definition: sql_exchange.h:43
Definition: thr_lock.h:99
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40
const char * str
Definition: mysql_lex_string.h:41
Definition: mysql_lex_string.h:35
char * str
Definition: mysql_lex_string.h:36
Bison "location" class.
Definition: parse_location.h:43
Definition: table.h:287
const char * used_alias
Tells whether this ORDER element was referenced with an alias or with an expression in the query,...
Definition: table.h:325
Item * item_initial
The initial ordering expression.
Definition: table.h:304
ORDER * next
Definition: table.h:291
enum_order direction
Definition: table.h:316
table_map used
Definition: table.h:337
Definition: parse_tree_node_base.h:403
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:420
THD *const thd
Current thread handler.
Definition: parse_tree_node_base.h:421
MEM_ROOT * mem_root
Current MEM_ROOT.
Definition: parse_tree_node_base.h:422
This class is used for representing both static and dynamic privileges on global as well as table and...
Definition: parse_tree_nodes.h:3165
const Mem_root_array< LEX_CSTRING > * columns
Definition: parse_tree_nodes.h:3169
Privilege(privilege_type type, const Mem_root_array< LEX_CSTRING > *columns)
Definition: parse_tree_nodes.h:3171
privilege_type
Definition: parse_tree_nodes.h:3166
@ STATIC
Definition: parse_tree_nodes.h:3166
@ DYNAMIC
Definition: parse_tree_nodes.h:3166
privilege_type type
Definition: parse_tree_nodes.h:3168
Info on properties that can be set with '–disable_X' and '–disable_X' commands.
Definition: mysqltest.cc:277
Definition: parse_tree_node_base.h:115
Definition: parser_yystype.h:198
Definition: sql_cmd_srs.h:41
Definition: parse_tree_nodes.h:3176
const uint grant
Definition: parse_tree_nodes.h:3177
Static_privilege(uint grant, const Mem_root_array< LEX_CSTRING > *columns_arg)
Definition: parse_tree_nodes.h:3179
Parse context for the table DDL (ALTER TABLE and CREATE TABLE) nodes.
Definition: parse_tree_nodes.h:203
HA_CREATE_INFO *const create_info
Definition: parse_tree_nodes.h:206
Alter_info *const alter_info
Definition: parse_tree_nodes.h:207
Table_ddl_parse_context(THD *thd_arg, Query_block *select_arg, Alter_info *alter_info)
Definition: parse_tree_nodes.cc:153
KEY_CREATE_INFO *const key_create_info
Definition: parse_tree_nodes.h:208
Structure used by parser to store options for tablespace statements and pass them on to Execution cla...
Definition: sql_tablespace.h:43
ulonglong redo_buffer_size
Definition: sql_tablespace.h:46
ulonglong undo_buffer_size
Definition: sql_tablespace.h:45
ulonglong file_block_size
Definition: sql_tablespace.h:50
std::optional< ulonglong > autoextend_size
Definition: sql_tablespace.h:48
uint nodegroup_id
Definition: sql_tablespace.h:51
LEX_STRING ts_comment
Definition: sql_tablespace.h:53
LEX_STRING encryption
Definition: sql_tablespace.h:55
ulonglong max_size
Definition: sql_tablespace.h:49
LEX_CSTRING engine_name
Definition: sql_tablespace.h:54
ulonglong initial_size
Definition: sql_tablespace.h:47
bool wait_until_completed
Definition: sql_tablespace.h:52
ulonglong extent_size
Definition: sql_tablespace.h:44
Definition: parser_yystype.h:323
Definition: task.h:427
Explain_format_type
Values for explain_format sysvar.
Definition: system_variables.h:115
tablesample_type
Definition: tablesample.h:27
thr_lock_type
Definition: thr_lock.h:51
@ TL_WRITE
Definition: thr_lock.h:92
@ TL_READ_WITH_SHARED_LOCKS
Definition: thr_lock.h:63
@ TL_IGNORE
Definition: thr_lock.h:52
thr_locked_row_action
Definition: thr_lock.h:97
command
Definition: version_token.cc:280
enum_window_frame_exclusion
Cf.
Definition: window_lex.h:48
enum_window_frame_unit
Cf.
Definition: window_lex.h:31
enum_window_border_type
Cf.
Definition: window_lex.h:37
@ WBT_VALUE_FOLLOWING
Definition: window_lex.h:40
@ WBT_VALUE_PRECEDING
Definition: window_lex.h:39