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