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