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