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