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