MySQL 8.0.39
Source Code Documentation
parse_tree_column_attrs.h
Go to the documentation of this file.
1/* Copyright (c) 2016, 2024, Oracle and/or its affiliates.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6
7 This program is designed to work with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have either included with
13 the program or referenced in the documentation.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef PARSE_TREE_COL_ATTRS_INCLUDED
25#define PARSE_TREE_COL_ATTRS_INCLUDED
26
27#include <assert.h>
28#include <sys/types.h> // ulong, uint. TODO: replace with cstdint
29
30#include <optional>
31#include <type_traits>
32#include <vector>
33
34#include "field_types.h"
35#include "lex_string.h"
36#include "m_ctype.h"
37#include "my_alloc.h"
38#include "my_base.h"
39#include "my_compiler.h"
40
41#include "my_inttypes.h"
42#include "my_sys.h"
43#include "mysql_com.h"
44#include "mysqld_error.h"
45#include "sql/derror.h"
46#include "sql/field.h"
47#include "sql/gis/srid.h"
48#include "sql/item.h"
49#include "sql/item_timefunc.h"
50#include "sql/mem_root_array.h"
51#include "sql/parse_location.h"
52#include "sql/parse_tree_helpers.h" // move_cf_appliers
54#include "sql/parser_yystype.h"
55#include "sql/sql_alter.h"
56#include "sql/sql_check_constraint.h" // Sql_check_constraint_spec
57#include "sql/sql_class.h"
58#include "sql/sql_error.h"
59#include "sql/sql_lex.h"
60#include "sql/sql_list.h"
61#include "sql/sql_parse.h"
63
64class String;
65
66/**
67 Parse context for column type attribute specific parse tree nodes.
68
69 For internal use in the contextualization code.
70
71 @ingroup ptn_column_attrs ptn_gcol_attrs
72*/
74 const bool is_generated; ///< Owner column is a generated one.
75 std::vector<CreateFieldApplier> cf_appliers;
76 Column_parse_context(THD *thd_arg, Query_block *select_arg, bool is_generated)
77 : Parse_context(thd_arg, select_arg), is_generated(is_generated) {}
78};
79
80/**
81 Base class for all column attributes in @SQL{CREATE/ALTER TABLE}
82
83 @ingroup ptn_column_attrs ptn_gcol_attrs
84*/
85class PT_column_attr_base : public Parse_tree_node_tmpl<Column_parse_context> {
86 protected:
88
89 public:
91
92 virtual void apply_type_flags(ulong *) const {}
93 virtual void apply_alter_info_flags(ulonglong *) const {}
94 virtual void apply_comment(LEX_CSTRING *) const {}
95 virtual void apply_default_value(Item **) const {}
97 virtual void apply_on_update_value(Item **) const {}
98 virtual void apply_srid_modifier(std::optional<gis::srid_t> *) const {}
100 const CHARSET_INFO **to [[maybe_unused]],
101 bool *has_explicit_collation
102 [[maybe_unused]]) const {
103 return false;
104 }
106 Sql_check_constraint_spec_list *check_const_list [[maybe_unused]]) {
107 return false;
108 }
109
110 /**
111 Check for the [NOT] ENFORCED characteristic.
112
113 @returns true if the [NOT] ENFORCED follows the CHECK(...) clause,
114 false otherwise.
115 */
116 virtual bool has_constraint_enforcement() const { return false; }
117
118 /**
119 Check if constraint is enforced.
120 Method must be called only when has_constraint_enforcement() is true (i.e
121 when [NOT] ENFORCED follows the CHECK(...) clause).
122
123 @returns true if constraint is enforced.
124 false otherwise.
125 */
126 virtual bool is_constraint_enforced() const { return false; }
127
128 /**
129 Update the ENFORCED/NOT ENFORCED state of the CHECK constraint.
130
131 @param enforced true if ENFORCED, false if NOT ENFORCED.
132
133 @returns false if success, true if error (e.g. if [NOT] ENFORCED follows
134 something other than the CHECK clause.)
135 */
136 virtual bool set_constraint_enforcement(bool enforced [[maybe_unused]]) {
137 return true; // error
138 }
139};
140
141/**
142 Node for the @SQL{NULL} column attribute
143
144 @ingroup ptn_column_attrs
145*/
147 public:
148 void apply_type_flags(ulong *type_flags) const override {
149 *type_flags &= ~NOT_NULL_FLAG;
150 *type_flags |= EXPLICIT_NULL_FLAG;
151 }
152};
153
154/**
155 Node for the @SQL{NOT NULL} column attribute
156
157 @ingroup ptn_column_attrs
158*/
160 void apply_type_flags(ulong *type_flags) const override {
161 *type_flags |= NOT_NULL_FLAG;
162 }
163};
164
165/**
166 Node for the @SQL{NOT SECONDARY} column attribute
167
168 @ingroup ptn_column_attrs
169*/
171 public:
172 void apply_type_flags(unsigned long *type_flags) const override {
173 *type_flags |= NOT_SECONDARY_FLAG;
174 }
175};
176
177/**
178 Node for the @SQL{UNIQUE [KEY]} column attribute
179
180 @ingroup ptn_column_attrs
181*/
183 public:
184 void apply_type_flags(ulong *type_flags) const override {
185 *type_flags |= UNIQUE_FLAG;
186 }
187
188 void apply_alter_info_flags(ulonglong *flags) const override {
190 }
191};
192
193/**
194 Node for the @SQL{PRIMARY [KEY]} column attribute
195
196 @ingroup ptn_column_attrs
197*/
199 public:
200 void apply_type_flags(ulong *type_flags) const override {
201 *type_flags |= PRI_KEY_FLAG | NOT_NULL_FLAG;
202 }
203
204 void apply_alter_info_flags(ulonglong *flags) const override {
206 }
207};
208
209/**
210 Node for the @SQL{[CONSTRAINT [symbol]] CHECK '(' expr ')'} column attribute.
211
212 @ingroup ptn_column_attrs
213*/
217
218 public:
221 col_cc_spec.check_expr = expr;
222 }
223
224 bool set_constraint_enforcement(bool enforced) override {
225 col_cc_spec.is_enforced = enforced;
226 return false;
227 }
228
229 void apply_alter_info_flags(ulonglong *flags) const override {
231 }
232
234 Sql_check_constraint_spec_list *check_const_list) override {
235 assert(check_const_list != nullptr);
236 return (check_const_list->push_back(&col_cc_spec));
237 }
238
240 return (super::contextualize(pc) ||
242 }
243};
244
245/**
246 Node for the @SQL{[NOT] ENFORCED} column attribute.
247
248 @ingroup ptn_column_attrs
249*/
251 public:
252 explicit PT_constraint_enforcement_attr(bool enforced)
253 : m_enforced(enforced) {}
254
255 bool has_constraint_enforcement() const override { return true; }
256
257 bool is_constraint_enforced() const override { return m_enforced; }
258
259 private:
260 const bool m_enforced;
261};
262
263/**
264 Node for the @SQL{COMMENT @<comment@>} column attribute
265
266 @ingroup ptn_column_attrs
267*/
270
271 public:
273 : comment(comment) {}
274
275 void apply_comment(LEX_CSTRING *to) const override { *to = comment; }
276};
277
278/**
279 Node for the @SQL{COLLATE @<collation@>} column attribute
280
281 @ingroup ptn_column_attrs
282*/
284 public:
286 : m_pos(pos), m_collation(collation) {
287 assert(m_collation != nullptr);
288 }
289
291 bool *has_explicit_collation) const override {
292 if (*has_explicit_collation) {
293 pc->thd->syntax_error_at(m_pos, ER_INVALID_MULTIPLE_CLAUSES, "COLLATE");
294 return true;
295 }
296 *has_explicit_collation = true;
298 }
299
300 private:
301 const POS m_pos;
303};
304
305// Specific to non-generated columns only:
306
307/**
308 Node for the @SQL{DEFAULT @<expression@>} column attribute
309
310 @ingroup ptn_not_gcol_attr
311*/
314
316
317 public:
319 void apply_default_value(Item **value) const override { *value = item; }
320
322 if (pc->is_generated) {
323 my_error(ER_WRONG_USAGE, MYF(0), "DEFAULT", "generated column");
324 return true;
325 }
326 return super::contextualize(pc) || item->itemize(pc, &item);
327 }
328 void apply_type_flags(ulong *type_flags) const override {
329 if (item->type() == Item::NULL_ITEM) *type_flags |= EXPLICIT_NULL_FLAG;
330 }
331};
332
333/**
334 Node for the @SQL{UPDATE NOW[([@<precision@>])]} column attribute
335
336 @ingroup ptn_not_gcol_attr
337*/
340
343
344 public:
346 void apply_on_update_value(Item **value) const override { *value = item; }
347
349 if (pc->is_generated) {
350 my_error(ER_WRONG_USAGE, MYF(0), "ON UPDATE", "generated column");
351 return true;
352 }
353 if (super::contextualize(pc)) return true;
354
356 return item == nullptr;
357 }
358};
359
360/**
361 Node for the @SQL{AUTO_INCREMENT} column attribute
362
363 @ingroup ptn_not_gcol_attr
364*/
367
368 public:
369 void apply_type_flags(ulong *type_flags) const override {
370 *type_flags |= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG;
371 }
373 if (pc->is_generated) {
374 my_error(ER_WRONG_USAGE, MYF(0), "AUTO_INCREMENT", "generated column");
375 return true;
376 }
377 return super::contextualize(pc);
378 }
379};
380
381/**
382 Node for the @SQL{SERIAL DEFAULT VALUE} column attribute
383
384 @ingroup ptn_not_gcol_attr
385*/
388
389 public:
390 void apply_type_flags(ulong *type_flags) const override {
392 }
393 void apply_alter_info_flags(ulonglong *flags) const override {
395 }
397 if (pc->is_generated) {
398 my_error(ER_WRONG_USAGE, MYF(0), "SERIAL DEFAULT VALUE",
399 "generated column");
400 return true;
401 }
402 return super::contextualize(pc);
403 }
404};
405
406/**
407 Node for the @SQL{COLUMN_FORMAT @<DEFAULT|FIXED|DYNAMIC@>} column attribute
408
409 @ingroup ptn_not_gcol_attr
410*/
413
415
416 public:
418 : format(format) {}
419
420 void apply_type_flags(ulong *type_flags) const override {
421 *type_flags &= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK);
422 *type_flags |= format << FIELD_FLAGS_COLUMN_FORMAT;
423 }
425 if (pc->is_generated) {
426 my_error(ER_WRONG_USAGE, MYF(0), "COLUMN_FORMAT", "generated column");
427 return true;
428 }
429 return super::contextualize(pc);
430 }
431};
432
433/**
434 Node for the @SQL{STORAGE @<DEFAULT|DISK|MEMORY@>} column attribute
435
436 @ingroup ptn_not_gcol_attr
437*/
440
442
443 public:
445 : media(media) {}
446
447 void apply_type_flags(ulong *type_flags) const override {
448 *type_flags &= ~(FIELD_FLAGS_STORAGE_MEDIA_MASK);
449 *type_flags |= media << FIELD_FLAGS_STORAGE_MEDIA;
450 }
452 if (pc->is_generated) {
453 my_error(ER_WRONG_USAGE, MYF(0), "STORAGE", "generated column");
454 return true;
455 }
456 return super::contextualize(pc);
457 }
458};
459
460/// Node for the SRID column attribute
463
465
466 public:
467 explicit PT_srid_column_attr(gis::srid_t srid) : m_srid(srid) {}
468
469 void apply_srid_modifier(std::optional<gis::srid_t> *srid) const override {
470 *srid = m_srid;
471 }
472};
473
474/// Node for the generated default value, column attribute
477
478 public:
482 }
483
485 Value_generator **default_value_expression) override {
486 *default_value_expression = &m_default_value_expression;
487 }
488
490 // GC and default value expressions are mutually exclusive and thus only
491 // one is allowed to be present on the same column definition.
492 if (pc->is_generated) {
493 my_error(ER_WRONG_USAGE, MYF(0), "DEFAULT", "generated column");
494 return true;
495 }
496 Parse_context expr_pc(pc->thd, pc->select);
497 return super::contextualize(pc) ||
500 }
501
502 private:
504};
505
506/**
507 Node for the @SQL{VISIBLE|INVISIBLE} column attribute
508
509 @ingroup ptn_column_attrs
510*/
512 public:
513 explicit PT_column_visibility_attr(bool is_visible)
514 : m_is_visible(is_visible) {}
515 void apply_type_flags(unsigned long *type_flags) const override {
516 *type_flags &= ~FIELD_IS_INVISIBLE;
517 if (!m_is_visible) *type_flags |= FIELD_IS_INVISIBLE;
518 }
519
520 private:
521 const bool m_is_visible;
522};
523
524// Type nodes:
525
526/**
527 Base class for all column type nodes
528
529 @ingroup ptn_column_types
530*/
531class PT_type : public Parse_tree_node {
532 public:
534
535 protected:
537
538 public:
539 virtual ulong get_type_flags() const { return 0; }
540 virtual const char *get_length() const { return nullptr; }
541 virtual const char *get_dec() const { return nullptr; }
542 virtual const CHARSET_INFO *get_charset() const { return nullptr; }
543 virtual uint get_uint_geom_type() const { return 0; }
544 virtual List<String> *get_interval_list() const { return nullptr; }
545 virtual bool is_serial_type() const { return false; }
546};
547
548/**
549 Node for numeric types
550
551 Type list:
552 * NUMERIC, REAL, DOUBLE, DECIMAL and FIXED,
553 * INTEGER, INT, INT1, INT2, INT3, INT4, TINYINT, SMALLINT, MEDIUMINT and
554 BIGINT.
555
556 @ingroup ptn_column_types
557*/
558class PT_numeric_type : public PT_type {
559 const char *length;
560 const char *dec;
561 ulong options;
562
563 using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
564
565 public:
566 PT_numeric_type(THD *thd, Numeric_type type_arg, const char *length,
567 const char *dec, ulong options)
568 : PT_type(static_cast<Parent_type>(type_arg)),
569 length(length),
570 dec(dec),
572 assert((options & ~(UNSIGNED_FLAG | ZEROFILL_FLAG)) == 0);
573
574 if (type_arg != Numeric_type::DECIMAL && dec != nullptr) {
576 ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
577 ER_THD(thd, ER_WARN_DEPRECATED_FLOAT_DIGITS));
578 }
579 if (options & UNSIGNED_FLAG) {
581 ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
582 ER_THD(thd, ER_WARN_DEPRECATED_FLOAT_UNSIGNED));
583 }
584 }
585 PT_numeric_type(THD *thd, Int_type type_arg, const char *length,
586 ulong options)
587 : PT_type(static_cast<enum_field_types>(type_arg)),
588 length(length),
589 dec(nullptr),
591 assert((options & ~(UNSIGNED_FLAG | ZEROFILL_FLAG)) == 0);
592
593 if (length != nullptr) {
595 ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
596 ER_THD(thd, ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH));
597 }
598 }
599
600 ulong get_type_flags() const override {
602 }
603 const char *get_length() const override { return length; }
604 const char *get_dec() const override { return dec; }
605};
606
607/**
608 Node for the BIT type
609
610 @ingroup ptn_column_types
611*/
612class PT_bit_type : public PT_type {
613 const char *length;
614
615 public:
617 explicit PT_bit_type(const char *length)
619
620 const char *get_length() const override { return length; }
621};
622
623/**
624 Node for the BOOL/BOOLEAN type
625
626 @ingroup ptn_column_types
627*/
628class PT_boolean_type : public PT_type {
629 public:
631 const char *get_length() const override { return "1"; }
632};
633
634enum class Char_type : ulong {
638};
639
640class PT_char_type : public PT_type {
641 const char *length;
643 const bool force_binary;
644
645 using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
646
647 public:
648 PT_char_type(Char_type char_type, const char *length,
649 const CHARSET_INFO *charset, bool force_binary = false)
650 : PT_type(static_cast<Parent_type>(char_type)),
651 length(length),
654 assert(charset == nullptr || !force_binary);
655 }
657 bool force_binary = false)
658 : PT_char_type(char_type, "1", charset, force_binary) {}
659 ulong get_type_flags() const override {
660 return force_binary ? BINCMP_FLAG : 0;
661 }
662 const char *get_length() const override { return length; }
663 const CHARSET_INFO *get_charset() const override { return charset; }
664};
665
666enum class Blob_type {
670};
671
672/**
673 Node for BLOB types
674
675 Types: BLOB, TINYBLOB, MEDIUMBLOB, LONGBLOB, LONG, LONG VARBINARY,
676 LONG VARCHAR, TEXT, TINYTEXT, MEDIUMTEXT, LONGTEXT.
677
678 @ingroup ptn_column_types
679*/
680class PT_blob_type : public PT_type {
681 const char *length;
683 const bool force_binary;
684
685 using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
686
687 public:
689 bool force_binary = false)
690 : PT_type(static_cast<Parent_type>(blob_type)),
694 assert(charset == nullptr || !force_binary);
695 }
696 explicit PT_blob_type(const char *length)
698 length(length),
700 force_binary(false) {}
701
702 ulong get_type_flags() const override {
703 return force_binary ? BINCMP_FLAG : 0;
704 }
705 const CHARSET_INFO *get_charset() const override { return charset; }
706 const char *get_length() const override { return length; }
707};
708
709/**
710 Node for the YEAR type
711
712 @ingroup ptn_column_types
713*/
714class PT_year_type : public PT_type {
715 public:
717};
718
719/**
720 Node for the DATE type
721
722 @ingroup ptn_column_types
723*/
724class PT_date_type : public PT_type {
725 public:
727};
728
729enum class Time_type : ulong {
732};
733
734/**
735 Node for the TIME, TIMESTAMP and DATETIME types
736
737 @ingroup ptn_column_types
738*/
739class PT_time_type : public PT_type {
740 const char *dec;
741
742 using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
743
744 public:
745 PT_time_type(Time_type time_type, const char *dec)
746 : PT_type(static_cast<Parent_type>(time_type)), dec(dec) {}
747
748 const char *get_dec() const override { return dec; }
749};
750
751/**
752 Node for the TIMESTAMP type
753
754 @ingroup ptn_column_types
755*/
757 typedef PT_type super;
758
759 const char *dec;
761
762 public:
763 explicit PT_timestamp_type(const char *dec)
765
766 const char *get_dec() const override { return dec; }
767 ulong get_type_flags() const override { return type_flags; }
768
769 bool contextualize(Parse_context *pc) override {
770 if (super::contextualize(pc)) return true;
771 /*
772 TIMESTAMP fields are NOT NULL by default, unless the variable
773 explicit_defaults_for_timestamp is true.
774 */
775 if (!pc->thd->variables.explicit_defaults_for_timestamp)
777 /*
778 To flag the current statement as dependent for binary
779 logging on the session var. Extra copying to Lex is
780 done in case prepared stmt.
781 */
784
785 return false;
786 }
787};
788
789/**
790 Node for spatial types
791
792 Types: GEOMETRY, GEOMCOLLECTION/GEOMETRYCOLLECTION, POINT, MULTIPOINT,
793 LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON
794
795 @ingroup ptn_column_types
796*/
797class PT_spacial_type : public PT_type {
799
800 public:
803
804 const CHARSET_INFO *get_charset() const override { return &my_charset_bin; }
805 uint get_uint_geom_type() const override { return geo_type; }
806 const char *get_length() const override { return nullptr; }
807};
808
810
811template <Enum_type enum_type>
815 const bool force_binary;
816
817 using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
818
819 public:
821 bool force_binary)
822 : PT_type(static_cast<Parent_type>(enum_type)),
826 assert(charset == nullptr || !force_binary);
827 }
828
829 const CHARSET_INFO *get_charset() const override { return charset; }
830 ulong get_type_flags() const override {
831 return force_binary ? BINCMP_FLAG : 0;
832 }
833 List<String> *get_interval_list() const override { return interval_list; }
834};
835
836/**
837 Node for the ENUM type
838
839 @ingroup ptn_column_types
840*/
842
843/**
844 Node for the SET type
845
846 @ingroup ptn_column_types
847*/
849
850class PT_serial_type : public PT_type {
851 public:
853
854 ulong get_type_flags() const override {
856 }
857 bool is_serial_type() const override { return true; }
858};
859
860/**
861 Node for the JSON type
862
863 @ingroup ptn_column_types
864*/
865class PT_json_type : public PT_type {
866 public:
868 const CHARSET_INFO *get_charset() const override { return &my_charset_bin; }
869};
870
871/**
872 Base class for both generated and regular column definitions
873
874 @ingroup ptn_create_table
875*/
879
880 public:
883 const char *length;
884 const char *dec;
894 /// Holds the expression to generate default values
896 std::optional<gis::srid_t> m_srid;
897 // List of column check constraint's specification.
899
900 protected:
902
904 : has_explicit_collation(false),
912
913 public:
914 bool contextualize(Parse_context *pc) override {
915 if (super::contextualize(pc) || type_node->contextualize(pc)) return true;
916
920 dec = type_node->get_dec();
926 if (check_const_spec_list == nullptr) return true; // OOM
927 return false;
928 }
929
930 protected:
931 template <class T>
933 Mem_root_array<T *> *attrs) {
934 if (attrs != nullptr) {
935 for (auto attr : *attrs) {
936 if (attr->contextualize(pc)) return true;
937 attr->apply_type_flags(&type_flags);
938 attr->apply_alter_info_flags(&alter_info_flags);
939 attr->apply_comment(&comment);
940 attr->apply_default_value(&default_value);
941 attr->apply_gen_default_value(&default_val_info);
942 attr->apply_on_update_value(&on_update_value);
943 attr->apply_srid_modifier(&m_srid);
944 if (attr->apply_collation(pc, &charset, &has_explicit_collation))
945 return true;
946 if (attr->add_check_constraints(check_const_spec_list)) return true;
947 }
948 }
949 return false;
950 }
951};
952
953/**
954 Base class for regular (non-generated) column definition nodes
955
956 @ingroup ptn_create_table
957*/
960
962
963 public:
964 PT_field_def(PT_type *type_node_arg,
966 : super(type_node_arg), opt_attrs(opt_attrs) {}
967
968 bool contextualize(Parse_context *pc_arg) override {
969 Column_parse_context pc(pc_arg->thd, pc_arg->select, false);
971 return true;
972
973 move_cf_appliers(pc_arg, &pc);
974 return false;
975 }
976};
977
978/**
979 Base class for generated column definition nodes
980
981 @ingroup ptn_create_table
982*/
985
989
990 public:
994 : super(type_node_arg),
996 expr(expr),
998
999 bool contextualize(Parse_context *pc_arg) override {
1000 Column_parse_context pc(pc_arg->thd, pc_arg->select, true);
1002 expr->itemize(&pc, &expr))
1003 return true;
1004
1005 // column of type serial cannot be generated
1006 if (type_node->is_serial_type()) {
1007 my_error(ER_WRONG_USAGE, MYF(0), "SERIAL", "generated column");
1008 return true;
1009 }
1010
1012 if (gcol_info == nullptr) return true; // OOM
1017
1018 return false;
1019 }
1020};
1021
1023
1024#endif /* PARSE_TREE_COL_ATTRS_INCLUDED */
ulonglong flags
Definition: sql_alter.h:428
@ ADD_CHECK_CONSTRAINT
Set for add check constraint.
Definition: sql_alter.h:318
@ ALTER_ADD_INDEX
Set for ADD INDEX | ADD KEY | ADD PRIMARY KEY | ADD UNIQUE KEY | ADD UNIQUE INDEX | ALTER ADD [COLUMN...
Definition: sql_alter.h:228
geometry_type
Definition: field.h:718
Definition: item_timefunc.h:1155
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:853
virtual bool itemize(Parse_context *pc, Item **res)
The same as contextualize() but with additional parameter.
Definition: item.cc:631
@ NULL_ITEM
Definition: item.h:897
virtual enum Type type() const =0
Definition: sql_list.h:434
bool push_back(const Element_type &element)
Adds a new element at the end of the array, after its current last element.
Definition: mem_root_array.h:186
Node for the AUTO_INCREMENT column attribute.
Definition: parse_tree_column_attrs.h:365
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:366
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:369
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:372
Node for the BIT type.
Definition: parse_tree_column_attrs.h:612
PT_bit_type(const char *length)
Definition: parse_tree_column_attrs.h:617
const char * get_length() const override
Definition: parse_tree_column_attrs.h:620
const char * length
Definition: parse_tree_column_attrs.h:613
PT_bit_type()
Definition: parse_tree_column_attrs.h:616
Node for BLOB types.
Definition: parse_tree_column_attrs.h:680
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:682
const char * length
Definition: parse_tree_column_attrs.h:681
PT_blob_type(const char *length)
Definition: parse_tree_column_attrs.h:696
const char * get_length() const override
Definition: parse_tree_column_attrs.h:706
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:705
PT_blob_type(Blob_type blob_type, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:688
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:702
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:685
const bool force_binary
Definition: parse_tree_column_attrs.h:683
Node for the BOOL/BOOLEAN type.
Definition: parse_tree_column_attrs.h:628
const char * get_length() const override
Definition: parse_tree_column_attrs.h:631
PT_boolean_type()
Definition: parse_tree_column_attrs.h:630
Definition: parse_tree_column_attrs.h:640
PT_char_type(Char_type char_type, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:656
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:645
const char * length
Definition: parse_tree_column_attrs.h:641
const char * get_length() const override
Definition: parse_tree_column_attrs.h:662
PT_char_type(Char_type char_type, const char *length, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:648
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:659
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:663
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:642
const bool force_binary
Definition: parse_tree_column_attrs.h:643
Node for the [CONSTRAINT [symbol]] CHECK '(' expr ')' column attribute.
Definition: parse_tree_column_attrs.h:214
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:239
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:229
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:215
bool add_check_constraints(Sql_check_constraint_spec_list *check_const_list) override
Definition: parse_tree_column_attrs.h:233
bool set_constraint_enforcement(bool enforced) override
Update the ENFORCED/NOT ENFORCED state of the CHECK constraint.
Definition: parse_tree_column_attrs.h:224
PT_check_constraint_column_attr(LEX_STRING &name, Item *expr)
Definition: parse_tree_column_attrs.h:219
Sql_check_constraint_spec col_cc_spec
Definition: parse_tree_column_attrs.h:216
Node for the COLLATE <collation> column attribute.
Definition: parse_tree_column_attrs.h:283
const POS m_pos
Definition: parse_tree_column_attrs.h:301
bool apply_collation(Column_parse_context *pc, const CHARSET_INFO **to, bool *has_explicit_collation) const override
Definition: parse_tree_column_attrs.h:290
PT_collate_column_attr(const POS &pos, const CHARSET_INFO *collation)
Definition: parse_tree_column_attrs.h:285
const CHARSET_INFO *const m_collation
Definition: parse_tree_column_attrs.h:302
Base class for all column attributes in CREATE/ALTER TABLE
Definition: parse_tree_column_attrs.h:85
decltype(Alter_info::flags) alter_info_flags_t
Definition: parse_tree_column_attrs.h:90
virtual bool is_constraint_enforced() const
Check if constraint is enforced.
Definition: parse_tree_column_attrs.h:126
virtual bool set_constraint_enforcement(bool enforced)
Update the ENFORCED/NOT ENFORCED state of the CHECK constraint.
Definition: parse_tree_column_attrs.h:136
virtual void apply_alter_info_flags(ulonglong *) const
Definition: parse_tree_column_attrs.h:93
virtual void apply_srid_modifier(std::optional< gis::srid_t > *) const
Definition: parse_tree_column_attrs.h:98
virtual bool apply_collation(Column_parse_context *, const CHARSET_INFO **to, bool *has_explicit_collation) const
Definition: parse_tree_column_attrs.h:99
virtual void apply_gen_default_value(Value_generator **)
Definition: parse_tree_column_attrs.h:96
virtual void apply_on_update_value(Item **) const
Definition: parse_tree_column_attrs.h:97
virtual void apply_type_flags(ulong *) const
Definition: parse_tree_column_attrs.h:92
virtual void apply_comment(LEX_CSTRING *) const
Definition: parse_tree_column_attrs.h:94
virtual bool add_check_constraints(Sql_check_constraint_spec_list *check_const_list)
Definition: parse_tree_column_attrs.h:105
PT_column_attr_base()=default
virtual bool has_constraint_enforcement() const
Check for the [NOT] ENFORCED characteristic.
Definition: parse_tree_column_attrs.h:116
virtual void apply_default_value(Item **) const
Definition: parse_tree_column_attrs.h:95
Node for the COLUMN_FORMAT <DEFAULT|FIXED|DYNAMIC> column attribute.
Definition: parse_tree_column_attrs.h:411
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:424
PT_column_format_column_attr(column_format_type format)
Definition: parse_tree_column_attrs.h:417
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:412
column_format_type format
Definition: parse_tree_column_attrs.h:414
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:420
Node for the VISIBLE|INVISIBLE column attribute.
Definition: parse_tree_column_attrs.h:511
PT_column_visibility_attr(bool is_visible)
Definition: parse_tree_column_attrs.h:513
void apply_type_flags(unsigned long *type_flags) const override
Definition: parse_tree_column_attrs.h:515
const bool m_is_visible
Definition: parse_tree_column_attrs.h:521
Node for the COMMENT <comment> column attribute.
Definition: parse_tree_column_attrs.h:268
void apply_comment(LEX_CSTRING *to) const override
Definition: parse_tree_column_attrs.h:275
PT_comment_column_attr(const LEX_CSTRING &comment)
Definition: parse_tree_column_attrs.h:272
const LEX_CSTRING comment
Definition: parse_tree_column_attrs.h:269
Node for the [NOT] ENFORCED column attribute.
Definition: parse_tree_column_attrs.h:250
bool has_constraint_enforcement() const override
Check for the [NOT] ENFORCED characteristic.
Definition: parse_tree_column_attrs.h:255
PT_constraint_enforcement_attr(bool enforced)
Definition: parse_tree_column_attrs.h:252
bool is_constraint_enforced() const override
Check if constraint is enforced.
Definition: parse_tree_column_attrs.h:257
const bool m_enforced
Definition: parse_tree_column_attrs.h:260
Node for the DATE type.
Definition: parse_tree_column_attrs.h:724
PT_date_type()
Definition: parse_tree_column_attrs.h:726
Node for the DEFAULT <expression> column attribute.
Definition: parse_tree_column_attrs.h:312
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:328
void apply_default_value(Item **value) const override
Definition: parse_tree_column_attrs.h:319
PT_default_column_attr(Item *item)
Definition: parse_tree_column_attrs.h:318
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:321
Item * item
Definition: parse_tree_column_attrs.h:315
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:313
Definition: parse_tree_column_attrs.h:812
List< String > *const interval_list
Definition: parse_tree_column_attrs.h:813
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:814
const bool force_binary
Definition: parse_tree_column_attrs.h:815
List< String > * get_interval_list() const override
Definition: parse_tree_column_attrs.h:833
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:829
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:830
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:817
PT_enum_type_tmpl(List< String > *interval_list, const CHARSET_INFO *charset, bool force_binary)
Definition: parse_tree_column_attrs.h:820
Base class for both generated and regular column definitions.
Definition: parse_tree_column_attrs.h:876
bool contextualize_attrs(Column_parse_context *pc, Mem_root_array< T * > *attrs)
Definition: parse_tree_column_attrs.h:932
LEX_CSTRING comment
Definition: parse_tree_column_attrs.h:890
enum_field_types type
Definition: parse_tree_column_attrs.h:881
decltype(Alter_info::flags) alter_info_flags_t
Definition: parse_tree_column_attrs.h:878
Value_generator * gcol_info
Definition: parse_tree_column_attrs.h:893
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:885
List< String > * interval_list
Definition: parse_tree_column_attrs.h:888
const char * dec
Definition: parse_tree_column_attrs.h:884
bool has_explicit_collation
Definition: parse_tree_column_attrs.h:886
Item * on_update_value
Definition: parse_tree_column_attrs.h:892
std::optional< gis::srid_t > m_srid
Definition: parse_tree_column_attrs.h:896
const char * length
Definition: parse_tree_column_attrs.h:883
Parse_tree_node super
Definition: parse_tree_column_attrs.h:877
PT_type * type_node
Definition: parse_tree_column_attrs.h:901
alter_info_flags_t alter_info_flags
Definition: parse_tree_column_attrs.h:889
Item * default_value
Definition: parse_tree_column_attrs.h:891
Value_generator * default_val_info
Holds the expression to generate default values.
Definition: parse_tree_column_attrs.h:895
bool contextualize(Parse_context *pc) override
Definition: parse_tree_column_attrs.h:914
Sql_check_constraint_spec_list * check_const_spec_list
Definition: parse_tree_column_attrs.h:898
ulong type_flags
Definition: parse_tree_column_attrs.h:882
PT_field_def_base(PT_type *type_node)
Definition: parse_tree_column_attrs.h:903
uint uint_geom_type
Definition: parse_tree_column_attrs.h:887
Base class for regular (non-generated) column definition nodes.
Definition: parse_tree_column_attrs.h:958
PT_field_def_base super
Definition: parse_tree_column_attrs.h:959
bool contextualize(Parse_context *pc_arg) override
Definition: parse_tree_column_attrs.h:968
PT_field_def(PT_type *type_node_arg, Mem_root_array< PT_column_attr_base * > *opt_attrs)
Definition: parse_tree_column_attrs.h:964
Mem_root_array< PT_column_attr_base * > * opt_attrs
Definition: parse_tree_column_attrs.h:961
Node for the generated default value, column attribute.
Definition: parse_tree_column_attrs.h:475
Value_generator m_default_value_expression
Definition: parse_tree_column_attrs.h:503
void apply_gen_default_value(Value_generator **default_value_expression) override
Definition: parse_tree_column_attrs.h:484
PT_generated_default_val_column_attr(Item *expr)
Definition: parse_tree_column_attrs.h:479
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:476
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:489
Base class for generated column definition nodes.
Definition: parse_tree_column_attrs.h:983
Item * expr
Definition: parse_tree_column_attrs.h:987
Mem_root_array< PT_column_attr_base * > * opt_attrs
Definition: parse_tree_column_attrs.h:988
PT_generated_field_def(PT_type *type_node_arg, Item *expr, Virtual_or_stored virtual_or_stored, Mem_root_array< PT_column_attr_base * > *opt_attrs)
Definition: parse_tree_column_attrs.h:991
PT_field_def_base super
Definition: parse_tree_column_attrs.h:984
const Virtual_or_stored virtual_or_stored
Definition: parse_tree_column_attrs.h:986
bool contextualize(Parse_context *pc_arg) override
Definition: parse_tree_column_attrs.h:999
Node for the JSON type.
Definition: parse_tree_column_attrs.h:865
PT_json_type()
Definition: parse_tree_column_attrs.h:867
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:868
Node for the NOT NULL column attribute.
Definition: parse_tree_column_attrs.h:159
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:160
Node for the NULL column attribute.
Definition: parse_tree_column_attrs.h:146
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:148
Node for numeric types.
Definition: parse_tree_column_attrs.h:558
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:604
PT_numeric_type(THD *thd, Numeric_type type_arg, const char *length, const char *dec, ulong options)
Definition: parse_tree_column_attrs.h:566
PT_numeric_type(THD *thd, Int_type type_arg, const char *length, ulong options)
Definition: parse_tree_column_attrs.h:585
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:563
const char * dec
Definition: parse_tree_column_attrs.h:560
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:600
const char * get_length() const override
Definition: parse_tree_column_attrs.h:603
ulong options
Definition: parse_tree_column_attrs.h:561
const char * length
Definition: parse_tree_column_attrs.h:559
Node for the UPDATE NOW[([<precision>])] column attribute.
Definition: parse_tree_column_attrs.h:338
PT_on_update_column_attr(uint8 precision)
Definition: parse_tree_column_attrs.h:345
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:348
const uint8 precision
Definition: parse_tree_column_attrs.h:341
void apply_on_update_value(Item **value) const override
Definition: parse_tree_column_attrs.h:346
Item * item
Definition: parse_tree_column_attrs.h:342
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:339
Node for the PRIMARY [KEY] column attribute.
Definition: parse_tree_column_attrs.h:198
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:204
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:200
Node for the NOT SECONDARY column attribute.
Definition: parse_tree_column_attrs.h:170
void apply_type_flags(unsigned long *type_flags) const override
Definition: parse_tree_column_attrs.h:172
Node for the SERIAL DEFAULT VALUE column attribute.
Definition: parse_tree_column_attrs.h:386
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:393
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:387
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:390
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:396
Definition: parse_tree_column_attrs.h:850
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:854
PT_serial_type()
Definition: parse_tree_column_attrs.h:852
bool is_serial_type() const override
Definition: parse_tree_column_attrs.h:857
Node for spatial types.
Definition: parse_tree_column_attrs.h:797
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:804
Field::geometry_type geo_type
Definition: parse_tree_column_attrs.h:798
uint get_uint_geom_type() const override
Definition: parse_tree_column_attrs.h:805
const char * get_length() const override
Definition: parse_tree_column_attrs.h:806
PT_spacial_type(Field::geometry_type geo_type)
Definition: parse_tree_column_attrs.h:801
Node for the SRID column attribute.
Definition: parse_tree_column_attrs.h:461
void apply_srid_modifier(std::optional< gis::srid_t > *srid) const override
Definition: parse_tree_column_attrs.h:469
PT_srid_column_attr(gis::srid_t srid)
Definition: parse_tree_column_attrs.h:467
gis::srid_t m_srid
Definition: parse_tree_column_attrs.h:464
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:462
Node for the STORAGE <DEFAULT|DISK|MEMORY> column attribute.
Definition: parse_tree_column_attrs.h:438
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:439
ha_storage_media media
Definition: parse_tree_column_attrs.h:441
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:447
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:451
PT_storage_media_column_attr(ha_storage_media media)
Definition: parse_tree_column_attrs.h:444
Node for the TIME, TIMESTAMP and DATETIME types.
Definition: parse_tree_column_attrs.h:739
const char * dec
Definition: parse_tree_column_attrs.h:740
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:748
PT_time_type(Time_type time_type, const char *dec)
Definition: parse_tree_column_attrs.h:745
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:742
Node for the TIMESTAMP type.
Definition: parse_tree_column_attrs.h:756
ulong type_flags
Definition: parse_tree_column_attrs.h:760
PT_timestamp_type(const char *dec)
Definition: parse_tree_column_attrs.h:763
const char * dec
Definition: parse_tree_column_attrs.h:759
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:766
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:767
bool contextualize(Parse_context *pc) override
Definition: parse_tree_column_attrs.h:769
PT_type super
Definition: parse_tree_column_attrs.h:757
Base class for all column type nodes.
Definition: parse_tree_column_attrs.h:531
virtual bool is_serial_type() const
Definition: parse_tree_column_attrs.h:545
virtual ulong get_type_flags() const
Definition: parse_tree_column_attrs.h:539
virtual const char * get_length() const
Definition: parse_tree_column_attrs.h:540
virtual const CHARSET_INFO * get_charset() const
Definition: parse_tree_column_attrs.h:542
virtual List< String > * get_interval_list() const
Definition: parse_tree_column_attrs.h:544
const enum_field_types type
Definition: parse_tree_column_attrs.h:533
virtual uint get_uint_geom_type() const
Definition: parse_tree_column_attrs.h:543
virtual const char * get_dec() const
Definition: parse_tree_column_attrs.h:541
PT_type(enum_field_types type)
Definition: parse_tree_column_attrs.h:536
Node for the UNIQUE [KEY] column attribute.
Definition: parse_tree_column_attrs.h:182
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:188
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:184
Node for the YEAR type.
Definition: parse_tree_column_attrs.h:714
PT_year_type()
Definition: parse_tree_column_attrs.h:716
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:139
virtual bool contextualize(Column_parse_context *pc)
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_node_base.h:187
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1156
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
@ SL_WARNING
Definition: sql_error.h:63
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:168
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
void syntax_error_at(const YYLTYPE &location)
Definition: sql_class.h:4385
LEX * lex
Definition: sql_class.h:981
System_variables variables
Definition: sql_lexer_thd.h:62
bool binlog_need_explicit_defaults_ts
The member is served for marking a query that CREATEs or ALTERs a table declared with a TIMESTAMP col...
Definition: sql_class.h:2562
MEM_ROOT * mem_root
Definition: sql_lexer_thd.h:38
Used for storing information associated with generated column, default values generated from expressi...
Definition: field.h:483
void set_field_stored(bool stored)
Definition: field.h:536
void set_field_type(enum_field_types fld_type)
Definition: field.h:519
Item * expr_item
Item representing the generation expression.
Definition: field.h:493
Mem_root_array< Sql_check_constraint_spec * > Sql_check_constraint_spec_list
Definition: dd_table.h:49
const char * ER_THD(const THD *thd, int mysql_errno)
Definition: derror.cc:103
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
This file contains the field type.
enum_field_types
Column types for MySQL.
Definition: field_types.h:53
@ MYSQL_TYPE_TIME2
Internal to MySQL.
Definition: field_types.h:73
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:69
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:62
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:83
@ MYSQL_TYPE_BLOB
Definition: field_types.h:84
@ MYSQL_TYPE_TINY
Definition: field_types.h:55
@ MYSQL_TYPE_SET
Definition: field_types.h:80
@ MYSQL_TYPE_JSON
Definition: field_types.h:77
@ MYSQL_TYPE_STRING
Definition: field_types.h:86
@ MYSQL_TYPE_ENUM
Definition: field_types.h:79
@ MYSQL_TYPE_TINY_BLOB
Definition: field_types.h:81
@ MYSQL_TYPE_BIT
Definition: field_types.h:70
@ MYSQL_TYPE_GEOMETRY
Definition: field_types.h:87
@ MYSQL_TYPE_MEDIUM_BLOB
Definition: field_types.h:82
@ MYSQL_TYPE_DATETIME2
Internal to MySQL.
Definition: field_types.h:72
@ MYSQL_TYPE_DATE
Definition: field_types.h:64
@ MYSQL_TYPE_TIMESTAMP2
Definition: field_types.h:71
@ MYSQL_TYPE_YEAR
Definition: field_types.h:67
bool merge_charset_and_collation(const CHARSET_INFO *charset, const CHARSET_INFO *collation, const CHARSET_INFO **to)
(end of group Runtime_Environment)
Definition: sql_parse.cc:7250
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:216
#define PRI_KEY_FLAG
Field is part of a primary key.
Definition: mysql_com.h:155
#define FIELD_FLAGS_COLUMN_FORMAT
Field column format, bit 24-25.
Definition: mysql_com.h:187
#define ZEROFILL_FLAG
Field is zerofill.
Definition: mysql_com.h:160
#define UNSIGNED_FLAG
Field is unsigned.
Definition: mysql_com.h:159
#define UNIQUE_FLAG
Intern: Used by sql_yacc.
Definition: mysql_com.h:173
#define AUTO_INCREMENT_FLAG
field is a autoincrement field
Definition: mysql_com.h:165
#define FIELD_FLAGS_COLUMN_FORMAT_MASK
Definition: mysql_com.h:188
#define NOT_NULL_FLAG
Field can't be NULL.
Definition: mysql_com.h:154
#define BINCMP_FLAG
Intern: Used by sql_yacc.
Definition: mysql_com.h:174
#define FIELD_IS_INVISIBLE
Field is explicitly marked as invisible by the user.
Definition: mysql_com.h:198
#define EXPLICIT_NULL_FLAG
Field is explicitly specified as \ NULL by the user.
Definition: mysql_com.h:190
#define FIELD_FLAGS_STORAGE_MEDIA_MASK
Definition: mysql_com.h:186
#define NOT_SECONDARY_FLAG
Field will not be loaded in secondary engine.
Definition: mysql_com.h:196
#define FIELD_FLAGS_STORAGE_MEDIA
Field storage media, bit 22-23.
Definition: mysql_com.h:185
static int flags[50]
Definition: hp_test1.cc:40
constexpr const LEX_CSTRING EMPTY_CSTR
Definition: lex_string.h:48
A better implementation of the UNIX ctype(3) library.
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:511
This file follows Google coding style, except for the name MEM_ROOT (which is kept for historical rea...
This file includes constants used by all storage engines.
ha_storage_media
Definition: my_base.h:115
Header for compiler-dependent features.
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint8_t uint8
Definition: my_inttypes.h:63
#define MYF(v)
Definition: my_inttypes.h:97
Common header for many mysys elements.
Common definition between mysql server & client.
const char * collation
Definition: audit_api_message_emit.cc:184
std::uint32_t srid_t
A spatial reference system ID (SRID).
Definition: srid.h:33
Definition: options.cc:49
Blob_type
Definition: parse_tree_column_attrs.h:666
Enum_type
Definition: parse_tree_column_attrs.h:809
Char_type
Definition: parse_tree_column_attrs.h:634
PT_enum_type_tmpl< Enum_type::ENUM > PT_enum_type
Node for the ENUM type.
Definition: parse_tree_column_attrs.h:841
PT_enum_type_tmpl< Enum_type::SET > PT_set_type
Node for the SET type.
Definition: parse_tree_column_attrs.h:848
Time_type
Definition: parse_tree_column_attrs.h:729
void move_cf_appliers(Parse_context *tddlpc, Column_parse_context *cpc)
Definition: parse_tree_helpers.cc:437
Int_type
Definition: parser_yystype.h:246
Numeric_type
Definition: parser_yystype.h:254
Virtual_or_stored
Definition: parser_yystype.h:244
column_format_type
Definition: field.h:190
void push_warning(THD *thd, Sql_condition::enum_severity_level severity, uint code, const char *message_text)
Push the warning to error list if there is still room in the list.
Definition: sql_error.cc:654
case opt name
Definition: sslopt-case.h:33
Definition: m_ctype.h:385
Parse context for column type attribute specific parse tree nodes.
Definition: parse_tree_column_attrs.h:73
const bool is_generated
Owner column is a generated one.
Definition: parse_tree_column_attrs.h:74
std::vector< CreateFieldApplier > cf_appliers
Definition: parse_tree_column_attrs.h:75
Column_parse_context(THD *thd_arg, Query_block *select_arg, bool is_generated)
Definition: parse_tree_column_attrs.h:76
bool binlog_need_explicit_defaults_ts
Definition: sql_lex.h:4197
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:121
Query_block * select
Current Query_block object.
Definition: parse_tree_node_base.h:124
THD *const thd
Current thread handler.
Definition: parse_tree_node_base.h:122
MEM_ROOT * mem_root
Current MEM_ROOT.
Definition: parse_tree_node_base.h:123
Bison "location" class.
Definition: parse_location.h:43
unsigned int uint
Definition: uca9-dump.cc:75