MySQL  8.0.19
Source Code Documentation
parse_tree_column_attrs.h
Go to the documentation of this file.
1 /* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
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 <type_traits>
27 
28 #include "my_dbug.h"
29 #include "mysql/mysql_lex_string.h"
30 #include "mysql_com.h"
31 #include "nullable.h"
32 #include "sql/gis/srid.h"
33 #include "sql/item_timefunc.h"
35 #include "sql/sql_alter.h"
36 #include "sql/sql_check_constraint.h" // Sql_check_constraint_spec
37 #include "sql/sql_class.h"
38 #include "sql/sql_error.h"
39 #include "sql/sql_lex.h"
40 #include "sql/sql_parse.h"
41 
42 using Mysql::Nullable;
43 
44 /**
45  Parse context for column type attribyte specific parse tree nodes.
46 
47  For internal use in the contextualization code.
48 
49  @ingroup ptn_column_attrs ptn_gcol_attrs
50 */
52  const bool is_generated; ///< Owner column is a generated one.
53 
54  Column_parse_context(THD *thd_arg, SELECT_LEX *select_arg, bool is_generated)
55  : Parse_context(thd_arg, select_arg), is_generated(is_generated) {}
56 };
57 
58 /**
59  Base class for all column attributes in @SQL{CREATE/ALTER TABLE}
60 
61  @ingroup ptn_column_attrs ptn_gcol_attrs
62 */
63 class PT_column_attr_base : public Parse_tree_node_tmpl<Column_parse_context> {
64  protected:
66 
67  public:
69 
70  virtual void apply_type_flags(ulong *) const {}
71  virtual void apply_alter_info_flags(ulonglong *) const {}
72  virtual void apply_comment(LEX_CSTRING *) const {}
73  virtual void apply_default_value(Item **) const {}
75  virtual void apply_on_update_value(Item **) const {}
76  virtual void apply_srid_modifier(Nullable<gis::srid_t> *) const {}
77  virtual bool apply_collation(
78  Column_parse_context *, const CHARSET_INFO **to MY_ATTRIBUTE((unused)),
79  bool *has_explicit_collation MY_ATTRIBUTE((unused))) const {
80  return false;
81  }
82  virtual bool add_check_constraints(
83  Sql_check_constraint_spec_list *check_const_list MY_ATTRIBUTE((unused))) {
84  return false;
85  }
86 
87  /**
88  Check for the [NOT] ENFORCED characteristic.
89 
90  @returns true if the [NOT] ENFORCED follows the CHECK(...) clause,
91  false otherwise.
92  */
93  virtual bool has_constraint_enforcement() const { return false; }
94 
95  /**
96  Check if constraint is enforced.
97  Method must be called only when has_constraint_enforcement() is true (i.e
98  when [NOT] ENFORCED follows the CHECK(...) clause).
99 
100  @returns true if constraint is enforced.
101  false otherwise.
102  */
103  virtual bool is_constraint_enforced() const { return false; }
104 
105  /**
106  Update the ENFORCED/NOT ENFORCED state of the CHECK constraint.
107 
108  @param enforced true if ENFORCED, false if NOT ENFORCED.
109 
110  @returns false if success, true if error (e.g. if [NOT] ENFORCED follows
111  something other than the CHECK clause.)
112  */
114  bool enforced MY_ATTRIBUTE((unused))) {
115  return true; // error
116  }
117 };
118 
119 /**
120  Node for the @SQL{NULL} column attribute
121 
122  @ingroup ptn_column_attrs
123 */
125  public:
126  void apply_type_flags(ulong *type_flags) const override {
127  *type_flags &= ~NOT_NULL_FLAG;
128  *type_flags |= EXPLICIT_NULL_FLAG;
129  }
130 };
131 
132 /**
133  Node for the @SQL{NOT NULL} column attribute
134 
135  @ingroup ptn_column_attrs
136 */
138  void apply_type_flags(ulong *type_flags) const override {
139  *type_flags |= NOT_NULL_FLAG;
140  }
141 };
142 
143 /**
144  Node for the @SQL{NOT SECONDARY} column attribute
145 
146  @ingroup ptn_column_attrs
147 */
149  public:
150  void apply_type_flags(unsigned long *type_flags) const override {
151  *type_flags |= NOT_SECONDARY_FLAG;
152  }
153 };
154 
155 /**
156  Node for the @SQL{UNIQUE [KEY]} column attribute
157 
158  @ingroup ptn_column_attrs
159 */
161  public:
162  void apply_type_flags(ulong *type_flags) const override {
163  *type_flags |= UNIQUE_FLAG;
164  }
165 
166  void apply_alter_info_flags(ulonglong *flags) const override {
168  }
169 };
170 
171 /**
172  Node for the @SQL{PRIMARY [KEY]} column attribute
173 
174  @ingroup ptn_column_attrs
175 */
177  public:
178  void apply_type_flags(ulong *type_flags) const override {
179  *type_flags |= PRI_KEY_FLAG | NOT_NULL_FLAG;
180  }
181 
182  void apply_alter_info_flags(ulonglong *flags) const override {
184  }
185 };
186 
187 /**
188  Node for the @SQL{[CONSTRAINT [symbol]] CHECK '(' expr ')'} column attribute.
189 
190  @ingroup ptn_column_attrs
191 */
195 
196  public:
199  col_cc_spec.check_expr = expr;
200  }
201 
202  bool set_constraint_enforcement(bool enforced) override {
203  col_cc_spec.is_enforced = enforced;
204  return false;
205  }
206 
207  void apply_alter_info_flags(ulonglong *flags) const override {
209  }
210 
212  Sql_check_constraint_spec_list *check_const_list) override {
213  DBUG_ASSERT(check_const_list != nullptr);
214  return (check_const_list->push_back(&col_cc_spec));
215  }
216 
217  bool contextualize(Column_parse_context *pc) override {
218  return (super::contextualize(pc) ||
220  }
221 };
222 
223 /**
224  Node for the @SQL{[NOT] ENFORCED} column attribute.
225 
226  @ingroup ptn_column_attrs
227 */
229  public:
230  explicit PT_constraint_enforcement_attr(bool enforced)
231  : m_enforced(enforced) {}
232 
233  bool has_constraint_enforcement() const override { return true; }
234 
235  bool is_constraint_enforced() const override { return m_enforced; }
236 
237  private:
238  const bool m_enforced;
239 };
240 
241 /**
242  Node for the @SQL{COMMENT @<comment@>} column attribute
243 
244  @ingroup ptn_column_attrs
245 */
248 
249  public:
251  : comment(comment) {}
252 
253  void apply_comment(LEX_CSTRING *to) const override { *to = comment; }
254 };
255 
256 /**
257  Node for the @SQL{COLLATE @<collation@>} column attribute
258 
259  @ingroup ptn_column_attrs
260 */
262  public:
265  DBUG_ASSERT(m_collation != nullptr);
266  }
267 
269  bool *has_explicit_collation) const override {
270  if (*has_explicit_collation) {
271  pc->thd->syntax_error_at(m_pos, ER_INVALID_MULTIPLE_CLAUSES, "COLLATE");
272  return true;
273  }
274  *has_explicit_collation = true;
275  return merge_charset_and_collation(*to, m_collation, to);
276  }
277 
278  private:
279  const POS m_pos;
280  const CHARSET_INFO *const m_collation;
281 };
282 
283 // Specific to non-generated columns only:
284 
285 /**
286  Node for the @SQL{DEFAULT @<expression@>} column attribute
287 
288  @ingroup ptn_not_gcol_attr
289 */
292 
294 
295  public:
297  void apply_default_value(Item **value) const override { *value = item; }
298 
299  bool contextualize(Column_parse_context *pc) override {
300  if (pc->is_generated) {
301  my_error(ER_WRONG_USAGE, MYF(0), "DEFAULT", "generated column");
302  return true;
303  }
304  return super::contextualize(pc) || item->itemize(pc, &item);
305  }
306  void apply_type_flags(ulong *type_flags) const override {
307  if (item->type() == Item::NULL_ITEM) *type_flags |= EXPLICIT_NULL_FLAG;
308  }
309 };
310 
311 /**
312  Node for the @SQL{UPDATE NOW[([@<precision@>])]} column attribute
313 
314  @ingroup ptn_not_gcol_attr
315 */
318 
321 
322  public:
324  void apply_on_update_value(Item **value) const override { *value = item; }
325 
326  bool contextualize(Column_parse_context *pc) override {
327  if (pc->is_generated) {
328  my_error(ER_WRONG_USAGE, MYF(0), "ON UPDATE", "generated column");
329  return true;
330  }
331  if (super::contextualize(pc)) return true;
332 
334  return item == NULL;
335  }
336 };
337 
338 /**
339  Node for the @SQL{AUTO_INCREMENT} column attribute
340 
341  @ingroup ptn_not_gcol_attr
342 */
345 
346  public:
347  void apply_type_flags(ulong *type_flags) const override {
348  *type_flags |= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG;
349  }
350  bool contextualize(Column_parse_context *pc) override {
351  if (pc->is_generated) {
352  my_error(ER_WRONG_USAGE, MYF(0), "AUTO_INCREMENT", "generated column");
353  return true;
354  }
355  return super::contextualize(pc);
356  }
357 };
358 
359 /**
360  Node for the @SQL{SERIAL DEFAULT VALUE} 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 | UNIQUE_FLAG;
370  }
371  void apply_alter_info_flags(ulonglong *flags) const override {
373  }
374  bool contextualize(Column_parse_context *pc) override {
375  if (pc->is_generated) {
376  my_error(ER_WRONG_USAGE, MYF(0), "SERIAL DEFAULT VALUE",
377  "generated column");
378  return true;
379  }
380  return super::contextualize(pc);
381  }
382 };
383 
384 /**
385  Node for the @SQL{COLUMN_FORMAT @<DEFAULT|FIXED|DYNAMIC@>} column attribute
386 
387  @ingroup ptn_not_gcol_attr
388 */
391 
393 
394  public:
396  : format(format) {}
397 
398  void apply_type_flags(ulong *type_flags) const override {
399  *type_flags &= ~(FIELD_FLAGS_COLUMN_FORMAT_MASK);
400  *type_flags |= format << FIELD_FLAGS_COLUMN_FORMAT;
401  }
402  bool contextualize(Column_parse_context *pc) override {
403  if (pc->is_generated) {
404  my_error(ER_WRONG_USAGE, MYF(0), "COLUMN_FORMAT", "generated column");
405  return true;
406  }
407  return super::contextualize(pc);
408  }
409 };
410 
411 /**
412  Node for the @SQL{STORAGE @<DEFAULT|DISK|MEMORY@>} column attribute
413 
414  @ingroup ptn_not_gcol_attr
415 */
418 
420 
421  public:
423  : media(media) {}
424 
425  void apply_type_flags(ulong *type_flags) const override {
426  *type_flags &= ~(FIELD_FLAGS_STORAGE_MEDIA_MASK);
427  *type_flags |= media << FIELD_FLAGS_STORAGE_MEDIA;
428  }
429  bool contextualize(Column_parse_context *pc) override {
430  if (pc->is_generated) {
431  my_error(ER_WRONG_USAGE, MYF(0), "STORAGE", "generated column");
432  return true;
433  }
434  return super::contextualize(pc);
435  }
436 };
437 
438 /// Node for the SRID column attribute
441 
443 
444  public:
445  explicit PT_srid_column_attr(gis::srid_t srid) : m_srid(srid) {}
446 
447  void apply_srid_modifier(Nullable<gis::srid_t> *srid) const override {
448  *srid = m_srid;
449  }
450 };
451 
452 /// Node for the generated default value, column attribute
455 
456  public:
460  }
461 
463  Value_generator **default_value_expression) override {
464  *default_value_expression = &m_default_value_expression;
465  }
466 
467  bool contextualize(Column_parse_context *pc) override {
468  // GC and default value expressions are mutually exclusive and thus only
469  // one is allowed to be present on the same column definition.
470  if (pc->is_generated) {
471  my_error(ER_WRONG_USAGE, MYF(0), "DEFAULT", "generated column");
472  return true;
473  }
474  Parse_context expr_pc(pc->thd, pc->select);
475  return super::contextualize(pc) ||
478  }
479 
480  private:
482 };
483 
484 // Type nodes:
485 
486 /**
487  Base class for all column type nodes
488 
489  @ingroup ptn_column_types
490 */
491 class PT_type : public Parse_tree_node {
492  public:
494 
495  protected:
497 
498  public:
499  virtual ulong get_type_flags() const { return 0; }
500  virtual const char *get_length() const { return NULL; }
501  virtual const char *get_dec() const { return NULL; }
502  virtual const CHARSET_INFO *get_charset() const { return NULL; }
503  virtual uint get_uint_geom_type() const { return 0; }
504  virtual List<String> *get_interval_list() const { return NULL; }
505 };
506 
507 /**
508  Node for numeric types
509 
510  Type list:
511  * NUMERIC, REAL, DOUBLE, DECIMAL and FIXED,
512  * INTEGER, INT, INT1, INT2, INT3, INT4, TINYINT, SMALLINT, MEDIUMINT and
513  BIGINT.
514 
515  @ingroup ptn_column_types
516 */
517 class PT_numeric_type : public PT_type {
518  const char *length;
519  const char *dec;
521 
522  using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
523 
524  public:
525  PT_numeric_type(THD *thd, Numeric_type type_arg, const char *length,
526  const char *dec, ulong options)
527  : PT_type(static_cast<Parent_type>(type_arg)),
528  length(length),
529  dec(dec),
530  options(options) {
532 
533  if (type_arg != Numeric_type::DECIMAL && dec != nullptr) {
535  ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
536  ER_THD(thd, ER_WARN_DEPRECATED_FLOAT_DIGITS));
537  }
538  if (options & UNSIGNED_FLAG) {
540  ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
541  ER_THD(thd, ER_WARN_DEPRECATED_FLOAT_UNSIGNED));
542  }
543  }
544  PT_numeric_type(THD *thd, Int_type type_arg, const char *length,
545  ulong options)
546  : PT_type(static_cast<enum_field_types>(type_arg)),
547  length(length),
548  dec(0),
549  options(options) {
551 
552  if (length != nullptr) {
554  ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
555  ER_THD(thd, ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH));
556  }
557  }
558 
559  ulong get_type_flags() const override {
561  }
562  const char *get_length() const override { return length; }
563  const char *get_dec() const override { return dec; }
564 };
565 
566 /**
567  Node for the BIT type
568 
569  @ingroup ptn_column_types
570 */
571 class PT_bit_type : public PT_type {
572  const char *length;
573 
574  public:
576  explicit PT_bit_type(const char *length)
578 
579  const char *get_length() const override { return length; }
580 };
581 
582 /**
583  Node for the BOOL/BOOLEAN type
584 
585  @ingroup ptn_column_types
586 */
587 class PT_boolean_type : public PT_type {
588  public:
590  const char *get_length() const override { return "1"; }
591 };
592 
593 enum class Char_type : ulong {
597 };
598 
599 class PT_char_type : public PT_type {
600  const char *length;
602  const bool force_binary;
603 
604  using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
605 
606  public:
607  PT_char_type(Char_type char_type, const char *length,
608  const CHARSET_INFO *charset, bool force_binary = false)
609  : PT_type(static_cast<Parent_type>(char_type)),
610  length(length),
611  charset(charset),
614  }
616  bool force_binary = false)
617  : PT_char_type(char_type, "1", charset, force_binary) {}
618  ulong get_type_flags() const override {
619  return force_binary ? BINCMP_FLAG : 0;
620  }
621  const char *get_length() const override { return length; }
622  const CHARSET_INFO *get_charset() const override { return charset; }
623 };
624 
625 enum class Blob_type {
629 };
630 
631 /**
632  Node for BLOB types
633 
634  Types: BLOB, TINYBLOB, MEDIUMBLOB, LONGBLOB, LONG, LONG VARBINARY,
635  LONG VARCHAR, TEXT, TINYTEXT, MEDIUMTEXT, LONGTEXT.
636 
637  @ingroup ptn_column_types
638 */
639 class PT_blob_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:
648  bool force_binary = false)
649  : PT_type(static_cast<Parent_type>(blob_type)),
650  length(NULL),
651  charset(charset),
654  }
655  explicit PT_blob_type(const char *length)
657  length(length),
659  force_binary(false) {}
660 
661  ulong get_type_flags() const override {
662  return force_binary ? BINCMP_FLAG : 0;
663  }
664  const CHARSET_INFO *get_charset() const override { return charset; }
665  const char *get_length() const override { return length; }
666 };
667 
668 /**
669  Node for the YEAR type
670 
671  @ingroup ptn_column_types
672 */
673 class PT_year_type : public PT_type {
674  public:
676 };
677 
678 /**
679  Node for the DATE type
680 
681  @ingroup ptn_column_types
682 */
683 class PT_date_type : public PT_type {
684  public:
686 };
687 
688 enum class Time_type : ulong {
691 };
692 
693 /**
694  Node for the TIME, TIMESTAMP and DATETIME types
695 
696  @ingroup ptn_column_types
697 */
698 class PT_time_type : public PT_type {
699  const char *dec;
700 
701  using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
702 
703  public:
704  PT_time_type(Time_type time_type, const char *dec)
705  : PT_type(static_cast<Parent_type>(time_type)), dec(dec) {}
706 
707  const char *get_dec() const override { return dec; }
708 };
709 
710 /**
711  Node for the TIMESTAMP type
712 
713  @ingroup ptn_column_types
714 */
715 class PT_timestamp_type : public PT_type {
716  typedef PT_type super;
717 
718  const char *dec;
720 
721  public:
722  explicit PT_timestamp_type(const char *dec)
724 
725  const char *get_dec() const override { return dec; }
726  ulong get_type_flags() const override { return type_flags; }
727 
728  bool contextualize(Parse_context *pc) override {
729  if (super::contextualize(pc)) return true;
730  /*
731  TIMESTAMP fields are NOT NULL by default, unless the variable
732  explicit_defaults_for_timestamp is true.
733  */
736  /*
737  To flag the current statement as dependent for binary
738  logging on the session var. Extra copying to Lex is
739  done in case prepared stmt.
740  */
743 
744  return false;
745  }
746 };
747 
748 /**
749  Node for spatial types
750 
751  Types: GEOMETRY, GEOMCOLLECTION/GEOMETRYCOLLECTION, POINT, MULTIPOINT,
752  LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON
753 
754  @ingroup ptn_column_types
755 */
756 class PT_spacial_type : public PT_type {
758 
759  public:
762 
763  const CHARSET_INFO *get_charset() const override { return &my_charset_bin; }
764  uint get_uint_geom_type() const override { return geo_type; }
765  const char *get_length() const override { return NULL; }
766 };
767 
769 
770 template <Enum_type enum_type>
771 class PT_enum_type_tmpl : public PT_type {
774  const bool force_binary;
775 
776  using Parent_type = std::remove_const<decltype(PT_type::type)>::type;
777 
778  public:
780  bool force_binary)
781  : PT_type(static_cast<Parent_type>(enum_type)),
783  charset(charset),
786  }
787 
788  const CHARSET_INFO *get_charset() const override { return charset; }
789  ulong get_type_flags() const override {
790  return force_binary ? BINCMP_FLAG : 0;
791  }
792  List<String> *get_interval_list() const override { return interval_list; }
793 };
794 
795 /**
796  Node for the ENUM type
797 
798  @ingroup ptn_column_types
799 */
801 
802 /**
803  Node for the SET type
804 
805  @ingroup ptn_column_types
806 */
808 
809 class PT_serial_type : public PT_type {
810  public:
812 
813  ulong get_type_flags() const override {
815  }
816 };
817 
818 /**
819  Node for the JSON type
820 
821  @ingroup ptn_column_types
822 */
823 class PT_json_type : public PT_type {
824  public:
826  const CHARSET_INFO *get_charset() const override { return &my_charset_bin; }
827 };
828 
829 /**
830  Base class for both generated and regular column definitions
831 
832  @ingroup ptn_create_table
833 */
837 
838  public:
841  const char *length;
842  const char *dec;
852  /// Holds the expression to generate default values
855  // List of column check constraint's specification.
857 
858  protected:
860 
863  alter_info_flags(0),
867  gcol_info(NULL),
868  default_val_info(nullptr),
869  type_node(type_node) {}
870 
871  public:
872  bool contextualize(Parse_context *pc) override {
873  if (super::contextualize(pc) || type_node->contextualize(pc)) return true;
874 
875  type = type_node->type;
878  dec = type_node->get_dec();
882  check_const_spec_list = new (pc->thd->mem_root)
884  if (check_const_spec_list == nullptr) return true; // OOM
885  return false;
886  }
887 
888  protected:
889  template <class T>
891  Mem_root_array<T *> *attrs) {
892  if (attrs != NULL) {
893  for (auto attr : *attrs) {
894  if (attr->contextualize(pc)) return true;
895  attr->apply_type_flags(&type_flags);
896  attr->apply_alter_info_flags(&alter_info_flags);
897  attr->apply_comment(&comment);
898  attr->apply_default_value(&default_value);
899  attr->apply_gen_default_value(&default_val_info);
900  attr->apply_on_update_value(&on_update_value);
901  attr->apply_srid_modifier(&m_srid);
902  if (attr->apply_collation(pc, &charset, &has_explicit_collation))
903  return true;
904  if (attr->add_check_constraints(check_const_spec_list)) return true;
905  }
906  }
907  return false;
908  }
909 };
910 
911 /**
912  Base class for regular (non-generated) column definition nodes
913 
914  @ingroup ptn_create_table
915 */
918 
920 
921  public:
922  PT_field_def(PT_type *type_node_arg,
924  : super(type_node_arg), opt_attrs(opt_attrs) {}
925 
926  bool contextualize(Parse_context *pc_arg) override {
927  Column_parse_context pc(pc_arg->thd, pc_arg->select, false);
929  }
930 };
931 
932 /**
933  Base class for generated column definition nodes
934 
935  @ingroup ptn_create_table
936 */
939 
943 
944  public:
948  : super(type_node_arg),
950  expr(expr),
951  opt_attrs(opt_attrs) {}
952 
953  bool contextualize(Parse_context *pc_arg) override {
954  Column_parse_context pc(pc_arg->thd, pc_arg->select, true);
956  expr->itemize(&pc, &expr))
957  return true;
958 
960  if (gcol_info == NULL) return true; // OOM
965 
966  return false;
967  }
968 };
969 
970 #endif /* PARSE_TREE_COL_ATTRS_INCLUDED */
PT_srid_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:440
PT_constraint_enforcement_attr::m_enforced
const bool m_enforced
Definition: parse_tree_column_attrs.h:238
PT_blob_type::PT_blob_type
PT_blob_type(Blob_type blob_type, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:647
PT_field_def_base::has_explicit_collation
bool has_explicit_collation
Definition: parse_tree_column_attrs.h:844
Parse_context::thd
THD *const thd
Current thread handler.
Definition: parse_tree_node_base.h:100
PT_spacial_type::PT_spacial_type
PT_spacial_type(Field::geometry_type geo_type)
Definition: parse_tree_column_attrs.h:760
sql_class.h
MYSQL_LEX_CSTRING
Definition: mysql_lex_string.h:39
PT_char_type::get_charset
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:622
PT_char_type::length
const char * length
Definition: parse_tree_column_attrs.h:600
Item
Definition: item.h:665
PT_enum_type_tmpl::get_interval_list
List< String > * get_interval_list() const override
Definition: parse_tree_column_attrs.h:792
PT_field_def_base::check_const_spec_list
Sql_check_constraint_spec_list * check_const_spec_list
Definition: parse_tree_column_attrs.h:856
THD
Definition: sql_class.h:764
PT_auto_increment_column_attr
Node for the AUTO_INCREMENT column attribute.
Definition: parse_tree_column_attrs.h:343
PT_generated_field_def::virtual_or_stored
const Virtual_or_stored virtual_or_stored
Definition: parse_tree_column_attrs.h:940
NOT_NULL_FLAG
#define NOT_NULL_FLAG
Field can't be NULL.
Definition: mysql_com.h:142
Mem_root_array< Sql_check_constraint_spec * >
MYSQL_TYPE_TIMESTAMP2
@ MYSQL_TYPE_TIMESTAMP2
Definition: field_types.h:74
PT_field_def_base::type
enum_field_types type
Definition: parse_tree_column_attrs.h:839
PT_auto_increment_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:347
PT_column_format_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:390
PT_column_attr_base::apply_on_update_value
virtual void apply_on_update_value(Item **) const
Definition: parse_tree_column_attrs.h:75
Time_type
Time_type
Definition: parse_tree_column_attrs.h:688
PT_serial_default_value_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:368
MYSQL_TYPE_GEOMETRY
@ MYSQL_TYPE_GEOMETRY
Definition: field_types.h:88
PT_type::get_type_flags
virtual ulong get_type_flags() const
Definition: parse_tree_column_attrs.h:499
PT_column_attr_base::apply_default_value
virtual void apply_default_value(Item **) const
Definition: parse_tree_column_attrs.h:73
PT_spacial_type::get_uint_geom_type
uint get_uint_geom_type() const override
Definition: parse_tree_column_attrs.h:764
PT_primary_key_column_attr
Node for the PRIMARY [KEY] column attribute.
Definition: parse_tree_column_attrs.h:176
MYSQL_TYPE_TINY_BLOB
@ MYSQL_TYPE_TINY_BLOB
Definition: field_types.h:82
PT_column_attr_base
Base class for all column attributes in CREATE/ALTER TABLE
Definition: parse_tree_column_attrs.h:63
PT_field_def_base::on_update_value
Item * on_update_value
Definition: parse_tree_column_attrs.h:850
PT_time_type::dec
const char * dec
Definition: parse_tree_column_attrs.h:699
Enum_type::ENUM
@ ENUM
NULL
#define NULL
Definition: types.h:55
MYSQL_TYPE_LONG_BLOB
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:84
Item_func_now_local
Definition: item_timefunc.h:1171
PT_numeric_type::Parent_type
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:522
PT_column_attr_base::apply_alter_info_flags
virtual void apply_alter_info_flags(ulonglong *) const
Definition: parse_tree_column_attrs.h:71
sql_alter.h
Item::NULL_ITEM
@ NULL_ITEM
Definition: item.h:709
Column_parse_context::Column_parse_context
Column_parse_context(THD *thd_arg, SELECT_LEX *select_arg, bool is_generated)
Definition: parse_tree_column_attrs.h:54
sql_lex.h
PT_time_type
Node for the TIME, TIMESTAMP and DATETIME types.
Definition: parse_tree_column_attrs.h:698
PT_enum_type_tmpl::interval_list
List< String > *const interval_list
Definition: parse_tree_column_attrs.h:772
CHARSET_INFO
Definition: m_ctype.h:354
PT_timestamp_type::get_type_flags
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:726
PT_type::get_length
virtual const char * get_length() const
Definition: parse_tree_column_attrs.h:500
MYSQL_TYPE_VARCHAR
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:72
PT_storage_media_column_attr::media
ha_storage_media media
Definition: parse_tree_column_attrs.h:419
PT_column_format_column_attr
Node for the COLUMN_FORMAT <DEFAULT|FIXED|DYNAMIC> column attribute.
Definition: parse_tree_column_attrs.h:389
PT_auto_increment_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:344
PT_column_attr_base::apply_gen_default_value
virtual void apply_gen_default_value(Value_generator **)
Definition: parse_tree_column_attrs.h:74
PT_type::PT_type
PT_type(enum_field_types type)
Definition: parse_tree_column_attrs.h:496
PT_bit_type
Node for the BIT type.
Definition: parse_tree_column_attrs.h:571
PT_numeric_type
Node for numeric types.
Definition: parse_tree_column_attrs.h:517
THD::lex
LEX * lex
Definition: sql_class.h:824
PT_generated_field_def
Base class for generated column definition nodes.
Definition: parse_tree_column_attrs.h:937
sql_check_constraint.h
PT_on_update_column_attr::precision
const uint8 precision
Definition: parse_tree_column_attrs.h:319
PT_column_format_column_attr::contextualize
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:402
UNIQUE_FLAG
#define UNIQUE_FLAG
Intern: Used by sql_yacc.
Definition: mysql_com.h:161
pos
char * pos
Definition: do_ctype.cc:76
Parse_tree_node_tmpl
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:111
my_dbug.h
PT_json_type::get_charset
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:826
PT_field_def_base::dec
const char * dec
Definition: parse_tree_column_attrs.h:842
PT_enum_type_tmpl::Parent_type
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:776
sql_error.h
PT_unique_key_column_attr::apply_alter_info_flags
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:166
PT_enum_type_tmpl::get_type_flags
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:789
PT_comment_column_attr::apply_comment
void apply_comment(LEX_CSTRING *to) const override
Definition: parse_tree_column_attrs.h:253
Column_parse_context::is_generated
const bool is_generated
Owner column is a generated one.
Definition: parse_tree_column_attrs.h:52
PT_generated_default_val_column_attr
Node for the generated default value, column attribute.
Definition: parse_tree_column_attrs.h:453
PT_spacial_type::get_charset
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:763
PT_char_type::Parent_type
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:604
PT_on_update_column_attr
Node for the UPDATE NOW[([<precision>])] column attribute.
Definition: parse_tree_column_attrs.h:316
PT_field_def_base::interval_list
List< String > * interval_list
Definition: parse_tree_column_attrs.h:846
PT_char_type::charset
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:601
PT_char_type::get_length
const char * get_length() const override
Definition: parse_tree_column_attrs.h:621
NOT_SECONDARY_FLAG
#define NOT_SECONDARY_FLAG
Field will not be loaded in secondary engine.
Definition: mysql_com.h:186
MYSQL_TYPE_BIT
@ MYSQL_TYPE_BIT
Definition: field_types.h:73
value
const string value("\"Value\"")
sql_parse.h
MYSQL_TYPE_STRING
@ MYSQL_TYPE_STRING
Definition: field_types.h:87
PT_blob_type::get_type_flags
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:661
THD::variables
struct System_variables variables
Definition: sql_class.h:943
PT_on_update_column_attr::contextualize
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:326
PT_blob_type::get_length
const char * get_length() const override
Definition: parse_tree_column_attrs.h:665
PT_year_type::PT_year_type
PT_year_type()
Definition: parse_tree_column_attrs.h:675
PT_column_attr_base::apply_srid_modifier
virtual void apply_srid_modifier(Nullable< gis::srid_t > *) const
Definition: parse_tree_column_attrs.h:76
PT_comment_column_attr::PT_comment_column_attr
PT_comment_column_attr(const LEX_CSTRING &comment)
Definition: parse_tree_column_attrs.h:250
PT_char_type::force_binary
const bool force_binary
Definition: parse_tree_column_attrs.h:602
EMPTY_CSTR
LEX_CSTRING EMPTY_CSTR
Definition: sql_class.cc:120
PT_field_def_base::default_val_info
Value_generator * default_val_info
Holds the expression to generate default values.
Definition: parse_tree_column_attrs.h:853
Blob_type::MEDIUM
@ MEDIUM
Char_type::TEXT
@ TEXT
PT_time_type::get_dec
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:707
PT_field_def_base
Base class for both generated and regular column definitions.
Definition: parse_tree_column_attrs.h:834
PT_bit_type::PT_bit_type
PT_bit_type()
Definition: parse_tree_column_attrs.h:575
PT_check_constraint_column_attr::set_constraint_enforcement
bool set_constraint_enforcement(bool enforced) override
Update the ENFORCED/NOT ENFORCED state of the CHECK constraint.
Definition: parse_tree_column_attrs.h:202
PT_generated_default_val_column_attr::contextualize
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:467
Enum_type
Enum_type
Definition: parse_tree_column_attrs.h:768
PT_field_def_base::contextualize
bool contextualize(Parse_context *pc) override
Definition: parse_tree_column_attrs.h:872
PT_unique_key_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:162
PT_blob_type::charset
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:641
PT_constraint_enforcement_attr::is_constraint_enforced
bool is_constraint_enforced() const override
Check if constraint is enforced.
Definition: parse_tree_column_attrs.h:235
PT_spacial_type
Node for spatial types.
Definition: parse_tree_column_attrs.h:756
PT_column_attr_base::apply_comment
virtual void apply_comment(LEX_CSTRING *) const
Definition: parse_tree_column_attrs.h:72
Mem_root_array_YY::push_back
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:189
Time_type::DATETIME
@ DATETIME
PT_field_def
Base class for regular (non-generated) column definition nodes.
Definition: parse_tree_column_attrs.h:916
PT_secondary_column_attr
Node for the NOT SECONDARY column attribute.
Definition: parse_tree_column_attrs.h:148
PT_serial_type::PT_serial_type
PT_serial_type()
Definition: parse_tree_column_attrs.h:811
LEX::binlog_need_explicit_defaults_ts
bool binlog_need_explicit_defaults_ts
Definition: sql_lex.h:3596
PT_field_def_base::super
Parse_tree_node super
Definition: parse_tree_column_attrs.h:835
PT_blob_type::get_charset
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:664
PRI_KEY_FLAG
#define PRI_KEY_FLAG
Field is part of a primary key.
Definition: mysql_com.h:143
PT_spacial_type::get_length
const char * get_length() const override
Definition: parse_tree_column_attrs.h:765
Parse_context::mem_root
MEM_ROOT * mem_root
Current MEM_ROOT.
Definition: parse_tree_node_base.h:101
PT_timestamp_type::get_dec
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:725
PT_constraint_enforcement_attr::PT_constraint_enforcement_attr
PT_constraint_enforcement_attr(bool enforced)
Definition: parse_tree_column_attrs.h:230
PT_column_format_column_attr::PT_column_format_column_attr
PT_column_format_column_attr(column_format_type format)
Definition: parse_tree_column_attrs.h:395
PT_on_update_column_attr::item
Item * item
Definition: parse_tree_column_attrs.h:320
PT_generated_default_val_column_attr::m_default_value_expression
Value_generator m_default_value_expression
Definition: parse_tree_column_attrs.h:481
Sql_check_constraint_spec
Class to represent the check constraint specifications obtained from the SQL statement parse.
Definition: sql_check_constraint.h:42
Numeric_type
Numeric_type
Definition: parser_yystype.h:158
PT_field_def_base::contextualize_attrs
bool contextualize_attrs(Column_parse_context *pc, Mem_root_array< T * > *attrs)
Definition: parse_tree_column_attrs.h:890
Alter_info::ALTER_ADD_INDEX
@ 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:213
PT_enum_type
PT_enum_type_tmpl< Enum_type::ENUM > PT_enum_type
Node for the ENUM type.
Definition: parse_tree_column_attrs.h:800
Parse_context::select
SELECT_LEX * select
Current SELECT_LEX object.
Definition: parse_tree_node_base.h:102
Mysql::Nullable
Class for storing value or NULL value.
Definition: nullable.h:40
PT_collate_column_attr::m_pos
const POS m_pos
Definition: parse_tree_column_attrs.h:279
Item::type
virtual enum Type type() const =0
Virtual_or_stored::STORED
@ STORED
PT_comment_column_attr::comment
const LEX_CSTRING comment
Definition: parse_tree_column_attrs.h:247
PT_generated_default_val_column_attr::PT_generated_default_val_column_attr
PT_generated_default_val_column_attr(Item *expr)
Definition: parse_tree_column_attrs.h:457
PT_check_constraint_column_attr::col_cc_spec
Sql_check_constraint_spec col_cc_spec
Definition: parse_tree_column_attrs.h:194
my_error
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:215
PT_collate_column_attr
Node for the COLLATE <collation> column attribute.
Definition: parse_tree_column_attrs.h:261
MYSQL_TYPE_BLOB
@ MYSQL_TYPE_BLOB
Definition: field_types.h:85
PT_serial_default_value_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:365
PT_collate_column_attr::PT_collate_column_attr
PT_collate_column_attr(const POS &pos, const CHARSET_INFO *collation)
Definition: parse_tree_column_attrs.h:263
PT_time_type::Parent_type
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:701
PT_column_attr_base::apply_collation
virtual bool apply_collation(Column_parse_context *, const CHARSET_INFO **to, bool *has_explicit_collation) const
Definition: parse_tree_column_attrs.h:77
PT_field_def_base::default_value
Item * default_value
Definition: parse_tree_column_attrs.h:849
PT_boolean_type::PT_boolean_type
PT_boolean_type()
Definition: parse_tree_column_attrs.h:589
PT_field_def_base::length
const char * length
Definition: parse_tree_column_attrs.h:841
PT_field_def_base::PT_field_def_base
PT_field_def_base(PT_type *type_node)
Definition: parse_tree_column_attrs.h:861
PT_check_constraint_column_attr::apply_alter_info_flags
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:207
PT_field_def::contextualize
bool contextualize(Parse_context *pc_arg) override
Definition: parse_tree_column_attrs.h:926
PT_numeric_type::get_type_flags
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:559
PT_field_def::opt_attrs
Mem_root_array< PT_column_attr_base * > * opt_attrs
Definition: parse_tree_column_attrs.h:919
Numeric_type::DECIMAL
@ DECIMAL
Sql_check_constraint_spec::name
LEX_STRING name
Name of the check constraint.
Definition: sql_check_constraint.h:76
PT_enum_type_tmpl::force_binary
const bool force_binary
Definition: parse_tree_column_attrs.h:774
MYSQL_TYPE_DATETIME2
@ MYSQL_TYPE_DATETIME2
Internal to MySQL.
Definition: field_types.h:75
PT_type::get_dec
virtual const char * get_dec() const
Definition: parse_tree_column_attrs.h:501
PT_type::get_uint_geom_type
virtual uint get_uint_geom_type() const
Definition: parse_tree_column_attrs.h:503
column_format_type
column_format_type
Definition: field.h:186
PT_boolean_type::get_length
const char * get_length() const override
Definition: parse_tree_column_attrs.h:590
PT_field_def_base::charset
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:843
PT_auto_increment_column_attr::contextualize
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:350
Query_arena::mem_root
MEM_ROOT * mem_root
Definition: sql_class.h:235
Value_generator::expr_item
Item * expr_item
Item representing the generation expression.
Definition: field.h:596
PT_check_constraint_column_attr
Node for the [CONSTRAINT [symbol]] CHECK '(' expr ')' column attribute.
Definition: parse_tree_column_attrs.h:192
PT_column_attr_base::is_constraint_enforced
virtual bool is_constraint_enforced() const
Check if constraint is enforced.
Definition: parse_tree_column_attrs.h:103
PT_timestamp_type
Node for the TIMESTAMP type.
Definition: parse_tree_column_attrs.h:715
Value_generator::set_field_stored
void set_field_stored(bool stored)
Definition: field.h:650
PT_numeric_type::options
ulong options
Definition: parse_tree_column_attrs.h:520
System_variables::explicit_defaults_for_timestamp
bool explicit_defaults_for_timestamp
Definition: system_variables.h:307
PT_storage_media_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:417
PT_serial_default_value_column_attr::contextualize
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:374
Value_generator::set_field_type
void set_field_type(enum_field_types fld_type)
Definition: field.h:633
PT_on_update_column_attr::apply_on_update_value
void apply_on_update_value(Item **value) const override
Definition: parse_tree_column_attrs.h:324
PT_blob_type::force_binary
const bool force_binary
Definition: parse_tree_column_attrs.h:642
PT_check_constraint_column_attr::add_check_constraints
bool add_check_constraints(Sql_check_constraint_spec_list *check_const_list) override
Definition: parse_tree_column_attrs.h:211
MYSQL_TYPE_DATE
@ MYSQL_TYPE_DATE
Definition: field_types.h:67
AUTO_INCREMENT_FLAG
#define AUTO_INCREMENT_FLAG
field is a autoincrement field
Definition: mysql_com.h:153
enum_field_types
enum_field_types
Column types for MySQL.
Definition: field_types.h:52
PT_default_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:291
PT_serial_default_value_column_attr::apply_alter_info_flags
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:371
PT_timestamp_type::super
PT_type super
Definition: parse_tree_column_attrs.h:716
PT_numeric_type::get_length
const char * get_length() const override
Definition: parse_tree_column_attrs.h:562
uint
unsigned int uint
Definition: uca-dump.cc:29
Alter_info::ADD_CHECK_CONSTRAINT
@ ADD_CHECK_CONSTRAINT
Set for add check constraint.
Definition: sql_alter.h:303
mysql_com.h
PT_on_update_column_attr::PT_on_update_column_attr
PT_on_update_column_attr(uint8 precision)
Definition: parse_tree_column_attrs.h:323
merge_charset_and_collation
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:7219
PT_field_def_base::alter_info_flags_t
decltype(Alter_info::flags) typedef alter_info_flags_t
Definition: parse_tree_column_attrs.h:836
udf_ext::consts::collation
const std::string collation("collation")
PT_char_type::PT_char_type
PT_char_type(Char_type char_type, const char *length, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:607
MYSQL_TYPE_SET
@ MYSQL_TYPE_SET
Definition: field_types.h:81
PT_primary_key_column_attr::apply_alter_info_flags
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:182
PT_column_attr_base::alter_info_flags_t
decltype(Alter_info::flags) typedef alter_info_flags_t
Definition: parse_tree_column_attrs.h:68
PT_generated_default_val_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:454
PT_generated_field_def::contextualize
bool contextualize(Parse_context *pc_arg) override
Definition: parse_tree_column_attrs.h:953
THD::binlog_need_explicit_defaults_ts
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:2244
PT_spacial_type::geo_type
Field::geometry_type geo_type
Definition: parse_tree_column_attrs.h:757
Field::geometry_type
geometry_type
Definition: field.h:823
PT_constraint_enforcement_attr
Node for the [NOT] ENFORCED column attribute.
Definition: parse_tree_column_attrs.h:228
Value_generator
Used for storing information associated with generated column, default values generated from expressi...
Definition: field.h:586
PT_unique_key_column_attr
Node for the UNIQUE [KEY] column attribute.
Definition: parse_tree_column_attrs.h:160
PT_column_attr_base::PT_column_attr_base
PT_column_attr_base()
Definition: parse_tree_column_attrs.h:65
PT_default_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:306
MYSQL_TYPE_YEAR
@ MYSQL_TYPE_YEAR
Definition: field_types.h:70
PT_check_constraint_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:193
PT_type::get_interval_list
virtual List< String > * get_interval_list() const
Definition: parse_tree_column_attrs.h:504
PT_field_def_base::gcol_info
Value_generator * gcol_info
Definition: parse_tree_column_attrs.h:851
PT_serial_type::get_type_flags
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:813
PT_serial_default_value_column_attr
Node for the SERIAL DEFAULT VALUE column attribute.
Definition: parse_tree_column_attrs.h:364
MYSQL_TYPE_TINY
@ MYSQL_TYPE_TINY
Definition: field_types.h:58
MYSQL_TYPE_ENUM
@ MYSQL_TYPE_ENUM
Definition: field_types.h:80
nullable.h
PT_default_column_attr::apply_default_value
void apply_default_value(Item **value) const override
Definition: parse_tree_column_attrs.h:297
PT_type::get_charset
virtual const CHARSET_INFO * get_charset() const
Definition: parse_tree_column_attrs.h:502
PT_primary_key_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:178
PT_column_attr_base::has_constraint_enforcement
virtual bool has_constraint_enforcement() const
Check for the [NOT] ENFORCED characteristic.
Definition: parse_tree_column_attrs.h:93
THD::syntax_error_at
void syntax_error_at(const YYLTYPE &location)
Definition: sql_class.h:3925
PT_blob_type
Node for BLOB types.
Definition: parse_tree_column_attrs.h:639
Alter_info::flags
ulonglong flags
Definition: sql_alter.h:402
PT_column_attr_base::apply_type_flags
virtual void apply_type_flags(ulong *) const
Definition: parse_tree_column_attrs.h:70
PT_generated_field_def::opt_attrs
Mem_root_array< PT_column_attr_base * > * opt_attrs
Definition: parse_tree_column_attrs.h:942
PT_storage_media_column_attr::contextualize
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:429
PT_char_type
Definition: parse_tree_column_attrs.h:599
PT_set_type
PT_enum_type_tmpl< Enum_type::SET > PT_set_type
Node for the SET type.
Definition: parse_tree_column_attrs.h:807
PT_not_null_column_attr
Node for the NOT NULL column attribute.
Definition: parse_tree_column_attrs.h:137
Sql_check_constraint_spec_list
Mem_root_array< Sql_check_constraint_spec * > Sql_check_constraint_spec_list
Definition: dd_table.h:48
PT_bit_type::length
const char * length
Definition: parse_tree_column_attrs.h:572
PT_field_def_base::type_flags
ulong type_flags
Definition: parse_tree_column_attrs.h:840
gis::srid_t
std::uint32_t srid_t
A spatial reference system ID (SRID).
Definition: srid.h:32
PT_enum_type_tmpl::PT_enum_type_tmpl
PT_enum_type_tmpl(List< String > *interval_list, const CHARSET_INFO *charset, bool force_binary)
Definition: parse_tree_column_attrs.h:779
PT_default_column_attr
Node for the DEFAULT <expression> column attribute.
Definition: parse_tree_column_attrs.h:290
PT_check_constraint_column_attr::contextualize
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:217
Sql_check_constraint_spec::is_enforced
bool is_enforced
Check constraint state (enforced/not enforced)
Definition: sql_check_constraint.h:85
PT_time_type::PT_time_type
PT_time_type(Time_type time_type, const char *dec)
Definition: parse_tree_column_attrs.h:704
PT_numeric_type::dec
const char * dec
Definition: parse_tree_column_attrs.h:519
PT_default_column_attr::item
Item * item
Definition: parse_tree_column_attrs.h:293
item_timefunc.h
PT_enum_type_tmpl::get_charset
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:788
ha_storage_media
ha_storage_media
Definition: my_base.h:114
PT_numeric_type::PT_numeric_type
PT_numeric_type(THD *thd, Int_type type_arg, const char *length, ulong options)
Definition: parse_tree_column_attrs.h:544
name
const string name("\"Name\"")
PT_json_type::PT_json_type
PT_json_type()
Definition: parse_tree_column_attrs.h:825
Item::itemize
virtual bool itemize(Parse_context *pc, Item **res)
The same as contextualize() but with additional parameter.
Definition: item.cc:588
PT_numeric_type::PT_numeric_type
PT_numeric_type(THD *thd, Numeric_type type_arg, const char *length, const char *dec, ulong options)
Definition: parse_tree_column_attrs.h:525
PT_boolean_type
Node for the BOOL/BOOLEAN type.
Definition: parse_tree_column_attrs.h:587
Sql_condition::SL_WARNING
@ SL_WARNING
Definition: sql_error.h:58
PT_srid_column_attr::PT_srid_column_attr
PT_srid_column_attr(gis::srid_t srid)
Definition: parse_tree_column_attrs.h:445
UNSIGNED_FLAG
#define UNSIGNED_FLAG
Field is unsigned.
Definition: mysql_com.h:147
PT_char_type::PT_char_type
PT_char_type(Char_type char_type, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:615
MYSQL_LEX_STRING
Definition: mysql_lex_string.h:34
PT_blob_type::PT_blob_type
PT_blob_type(const char *length)
Definition: parse_tree_column_attrs.h:655
YYLTYPE
Bison "location" class.
Definition: parse_location.h:43
PT_bit_type::get_length
const char * get_length() const override
Definition: parse_tree_column_attrs.h:579
PT_serial_type
Definition: parse_tree_column_attrs.h:809
Parse_tree_node_tmpl< Column_parse_context >::contextualize
virtual bool contextualize(Column_parse_context *pc)
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_node_base.h:159
Sql_check_constraint_spec::check_expr
Item * check_expr
Check constraint expression.
Definition: sql_check_constraint.h:79
MYSQL_TYPE_MEDIUM_BLOB
@ MYSQL_TYPE_MEDIUM_BLOB
Definition: field_types.h:83
PT_column_format_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:398
PT_type
Base class for all column type nodes.
Definition: parse_tree_column_attrs.h:491
uint8
uint8_t uint8
Definition: my_inttypes.h:62
ZEROFILL_FLAG
#define ZEROFILL_FLAG
Field is zerofill.
Definition: mysql_com.h:148
DBUG_ASSERT
#define DBUG_ASSERT(A)
Definition: my_dbug.h:197
Int_type
Int_type
Definition: parser_yystype.h:150
PT_generated_default_val_column_attr::apply_gen_default_value
void apply_gen_default_value(Value_generator **default_value_expression) override
Definition: parse_tree_column_attrs.h:462
PT_date_type::PT_date_type
PT_date_type()
Definition: parse_tree_column_attrs.h:685
PT_null_column_attr
Node for the NULL column attribute.
Definition: parse_tree_column_attrs.h:124
PT_field_def_base::m_srid
Nullable< gis::srid_t > m_srid
Definition: parse_tree_column_attrs.h:854
srid.h
PT_generated_field_def::PT_generated_field_def
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:945
ER_THD
const char * ER_THD(const THD *thd, int mysql_errno)
Definition: derror.cc:102
PT_date_type
Node for the DATE type.
Definition: parse_tree_column_attrs.h:683
PT_srid_column_attr::apply_srid_modifier
void apply_srid_modifier(Nullable< gis::srid_t > *srid) const override
Definition: parse_tree_column_attrs.h:447
mysql_lex_string.h
Blob_type::LONG
@ LONG
PT_timestamp_type::type_flags
ulong type_flags
Definition: parse_tree_column_attrs.h:719
PT_field_def_base::alter_info_flags
alter_info_flags_t alter_info_flags
Definition: parse_tree_column_attrs.h:847
PT_numeric_type::get_dec
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:563
MYSQL_TYPE_LONGLONG
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:65
my_charset_bin
MYSQL_PLUGIN_IMPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:510
BINCMP_FLAG
#define BINCMP_FLAG
Intern: Used by sql_yacc.
Definition: mysql_com.h:162
PT_json_type
Node for the JSON type.
Definition: parse_tree_column_attrs.h:823
FIELD_FLAGS_STORAGE_MEDIA
#define FIELD_FLAGS_STORAGE_MEDIA
Field storage media, bit 22-23.
Definition: mysql_com.h:173
PT_field_def::super
PT_field_def_base super
Definition: parse_tree_column_attrs.h:917
Parse_context
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:99
PT_field_def_base::type_node
PT_type * type_node
Definition: parse_tree_column_attrs.h:859
MYF
#define MYF(v)
Definition: my_inttypes.h:96
PT_generated_field_def::expr
Item * expr
Definition: parse_tree_column_attrs.h:941
PT_comment_column_attr
Node for the COMMENT <comment> column attribute.
Definition: parse_tree_column_attrs.h:246
Enum_type::SET
@ SET
MYSQL_TYPE_JSON
@ MYSQL_TYPE_JSON
Definition: field_types.h:78
PT_numeric_type::length
const char * length
Definition: parse_tree_column_attrs.h:518
PT_field_def_base::comment
LEX_CSTRING comment
Definition: parse_tree_column_attrs.h:848
PT_column_attr_base::set_constraint_enforcement
virtual bool set_constraint_enforcement(bool enforced)
Update the ENFORCED/NOT ENFORCED state of the CHECK constraint.
Definition: parse_tree_column_attrs.h:113
FIELD_FLAGS_COLUMN_FORMAT
#define FIELD_FLAGS_COLUMN_FORMAT
Field column format, bit 24-25.
Definition: mysql_com.h:175
PT_storage_media_column_attr
Node for the STORAGE <DEFAULT|DISK|MEMORY> column attribute.
Definition: parse_tree_column_attrs.h:416
parse_tree_node_base.h
ulong
unsigned long ulong
Definition: my_inttypes.h:48
PT_enum_type_tmpl::charset
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:773
PT_storage_media_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:425
ulonglong
unsigned long long int ulonglong
Definition: my_inttypes.h:55
Char_type::CHAR
@ CHAR
Blob_type
Blob_type
Definition: parse_tree_column_attrs.h:625
PT_constraint_enforcement_attr::has_constraint_enforcement
bool has_constraint_enforcement() const override
Check for the [NOT] ENFORCED characteristic.
Definition: parse_tree_column_attrs.h:233
Blob_type::TINY
@ TINY
List< String >
PT_type::type
const enum_field_types type
Definition: parse_tree_column_attrs.h:493
PT_default_column_attr::contextualize
bool contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:299
Column_parse_context
Parse context for column type attribyte specific parse tree nodes.
Definition: parse_tree_column_attrs.h:51
PT_default_column_attr::PT_default_column_attr
PT_default_column_attr(Item *item)
Definition: parse_tree_column_attrs.h:296
FIELD_FLAGS_STORAGE_MEDIA_MASK
#define FIELD_FLAGS_STORAGE_MEDIA_MASK
Definition: mysql_com.h:174
PT_on_update_column_attr::super
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:317
PT_srid_column_attr::m_srid
gis::srid_t m_srid
Definition: parse_tree_column_attrs.h:442
PT_field_def::PT_field_def
PT_field_def(PT_type *type_node_arg, Mem_root_array< PT_column_attr_base * > *opt_attrs)
Definition: parse_tree_column_attrs.h:922
PT_null_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:126
SELECT_LEX
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:986
MYSQL_TYPE_TIME2
@ MYSQL_TYPE_TIME2
Internal to MySQL.
Definition: field_types.h:76
PT_blob_type::Parent_type
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:644
PT_timestamp_type::PT_timestamp_type
PT_timestamp_type(const char *dec)
Definition: parse_tree_column_attrs.h:722
PT_bit_type::PT_bit_type
PT_bit_type(const char *length)
Definition: parse_tree_column_attrs.h:576
PT_collate_column_attr::m_collation
const CHARSET_INFO *const m_collation
Definition: parse_tree_column_attrs.h:280
PT_check_constraint_column_attr::PT_check_constraint_column_attr
PT_check_constraint_column_attr(LEX_STRING &name, Item *expr)
Definition: parse_tree_column_attrs.h:197
Char_type::VARCHAR
@ VARCHAR
PT_enum_type_tmpl
Definition: parse_tree_column_attrs.h:771
PT_year_type
Node for the YEAR type.
Definition: parse_tree_column_attrs.h:673
push_warning
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:650
FIELD_FLAGS_COLUMN_FORMAT_MASK
#define FIELD_FLAGS_COLUMN_FORMAT_MASK
Definition: mysql_com.h:176
Char_type
Char_type
Definition: parse_tree_column_attrs.h:593
PT_generated_field_def::super
PT_field_def_base super
Definition: parse_tree_column_attrs.h:938
PT_column_format_column_attr::format
column_format_type format
Definition: parse_tree_column_attrs.h:392
PT_field_def_base::uint_geom_type
uint uint_geom_type
Definition: parse_tree_column_attrs.h:845
PT_char_type::get_type_flags
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:618
PT_collate_column_attr::apply_collation
bool apply_collation(Column_parse_context *pc, const CHARSET_INFO **to, bool *has_explicit_collation) const override
Definition: parse_tree_column_attrs.h:268
PT_column_attr_base::add_check_constraints
virtual bool add_check_constraints(Sql_check_constraint_spec_list *check_const_list)
Definition: parse_tree_column_attrs.h:82
PT_timestamp_type::dec
const char * dec
Definition: parse_tree_column_attrs.h:718
EXPLICIT_NULL_FLAG
#define EXPLICIT_NULL_FLAG
Field is explicitly specified as \ NULL by the user.
Definition: mysql_com.h:178
PT_secondary_column_attr::apply_type_flags
void apply_type_flags(unsigned long *type_flags) const override
Definition: parse_tree_column_attrs.h:150
Time_type::TIME
@ TIME
PT_not_null_column_attr::apply_type_flags
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:138
PT_srid_column_attr
Node for the SRID column attribute.
Definition: parse_tree_column_attrs.h:439
flags
static int flags[50]
Definition: hp_test1.cc:39
PT_blob_type::length
const char * length
Definition: parse_tree_column_attrs.h:640
PT_storage_media_column_attr::PT_storage_media_column_attr
PT_storage_media_column_attr(ha_storage_media media)
Definition: parse_tree_column_attrs.h:422
PT_timestamp_type::contextualize
bool contextualize(Parse_context *pc) override
Definition: parse_tree_column_attrs.h:728
Virtual_or_stored
Virtual_or_stored
Definition: parser_yystype.h:148
false
#define false
Definition: config_static.h:43