24#ifndef PARSE_TREE_COL_ATTRS_INCLUDED
25#define PARSE_TREE_COL_ATTRS_INCLUDED
44#include "mysqld_error.h"
127 bool *has_explicit_collation
128 [[maybe_unused]])
const {
177 *type_flags &= ~NOT_NULL_FLAG;
289 assert(check_const_list !=
nullptr);
355 bool *has_explicit_collation)
const override {
356 if (*has_explicit_collation) {
360 *has_explicit_collation =
true;
388 my_error(ER_WRONG_USAGE,
MYF(0),
"DEFAULT",
"generated column");
418 my_error(ER_WRONG_USAGE,
MYF(0),
"ON UPDATE",
"generated column");
424 return item ==
nullptr;
447 my_error(ER_WRONG_USAGE,
MYF(0),
"AUTO_INCREMENT",
"generated column");
477 my_error(ER_WRONG_USAGE,
MYF(0),
"SERIAL DEFAULT VALUE",
509 my_error(ER_WRONG_USAGE,
MYF(0),
"COLUMN_FORMAT",
"generated column");
539 my_error(ER_WRONG_USAGE,
MYF(0),
"STORAGE",
"generated column");
586 my_error(ER_WRONG_USAGE,
MYF(0),
"DEFAULT",
"generated column");
640 *type_flags &= ~FIELD_IS_INVISIBLE;
670 virtual const char *
get_dec()
const {
return nullptr; }
705 ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
706 ER_THD(thd, ER_WARN_DEPRECATED_FLOAT_DIGITS));
710 ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
711 ER_THD(thd, ER_WARN_DEPRECATED_FLOAT_UNSIGNED));
724 ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
725 ER_THD(thd, ER_WARN_DEPRECATED_INTEGER_DISPLAY_WIDTH));
802 const char *length_arg =
length ==
nullptr ?
"2048" :
length;
803 uint vector_length = atoi(length_arg) *
sizeof(float);
920 if (!pc->
thd->
variables.explicit_defaults_for_timestamp)
956template <Enum_type enum_type>
1085 for (
auto attr : *attrs) {
1086 if (attr->attr_type() == cand->
attr_type())
return true;
1094 if (attrs !=
nullptr) {
1095 if (attrs->
size() > 1) {
1102 for (
long i =
static_cast<long>(attrs->
size()) - 1; i >= 0; i--) {
1109 for (
auto attr : *unique_attrs) attrs->
push_front(attr);
1112 for (
auto attr : *attrs) {
1113 if (attr->contextualize(pc))
return true;
1116 attr->apply_comment(&
comment);
1121 attr->apply_srid_modifier(&
m_srid);
1172 :
super(pos, type_node_arg),
1185 my_error(ER_WRONG_USAGE,
MYF(0),
"SERIAL",
"generated column");
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:247
ulonglong flags
Definition: sql_alter.h:440
@ ADD_CHECK_CONSTRAINT
Set for add check constraint.
Definition: sql_alter.h:324
@ 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:234
geometry_type
Definition: field.h:716
Definition: item_timefunc.h:1117
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:929
@ NULL_ITEM
A NULL value.
Definition: item.h:975
virtual bool itemize(Parse_context *pc, Item **res) final
The same as contextualize() but with additional parameter.
Definition: item.h:1249
virtual enum Type type() const =0
Definition: sql_list.h:494
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:187
size_t size() const
Definition: mem_root_array.h:413
bool push_front(const Element_type &element)
Adds a new element at the beginning of the array.
Definition: mem_root_array.h:229
void clear()
Erases all of the elements.
Definition: mem_root_array.h:130
bool reserve(size_t n)
Reserves space for array elements.
Definition: mem_root_array.h:156
Node for the AUTO_INCREMENT column attribute.
Definition: parse_tree_column_attrs.h:435
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:436
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:442
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:453
PT_auto_increment_column_attr(const POS &pos)
Definition: parse_tree_column_attrs.h:439
bool do_contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:445
Node for the BIT type.
Definition: parse_tree_column_attrs.h:741
PT_bit_type(const POS &pos)
Definition: parse_tree_column_attrs.h:745
const char * get_length() const override
Definition: parse_tree_column_attrs.h:750
const char * length
Definition: parse_tree_column_attrs.h:742
PT_bit_type(const POS &pos, const char *length)
Definition: parse_tree_column_attrs.h:747
Node for BLOB types.
Definition: parse_tree_column_attrs.h:825
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:827
PT_blob_type(const POS &pos, Blob_type blob_type, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:833
const char * length
Definition: parse_tree_column_attrs.h:826
PT_blob_type(const POS &pos, const char *length)
Definition: parse_tree_column_attrs.h:841
const char * get_length() const override
Definition: parse_tree_column_attrs.h:851
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:850
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:847
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:830
const bool force_binary
Definition: parse_tree_column_attrs.h:828
Node for the BOOL/BOOLEAN type.
Definition: parse_tree_column_attrs.h:758
const char * get_length() const override
Definition: parse_tree_column_attrs.h:761
PT_boolean_type(const POS &pos)
Definition: parse_tree_column_attrs.h:760
Definition: parse_tree_column_attrs.h:770
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:775
PT_char_type(const POS &pos, Char_type char_type, const char *length, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:778
const char * length
Definition: parse_tree_column_attrs.h:771
const char * get_length() const override
Definition: parse_tree_column_attrs.h:792
PT_char_type(const POS &pos, Char_type char_type, const CHARSET_INFO *charset, bool force_binary=false)
Definition: parse_tree_column_attrs.h:786
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:789
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:793
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:772
const bool force_binary
Definition: parse_tree_column_attrs.h:773
Node for the [CONSTRAINT [symbol]] CHECK '(' expr ')' column attribute.
Definition: parse_tree_column_attrs.h:266
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:283
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:298
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:267
bool add_check_constraints(Sql_check_constraint_spec_list *check_const_list) override
Definition: parse_tree_column_attrs.h:287
bool set_constraint_enforcement(bool enforced) override
Update the ENFORCED/NOT ENFORCED state of the CHECK constraint.
Definition: parse_tree_column_attrs.h:278
PT_check_constraint_column_attr(const POS &pos, LEX_STRING &name, Item *expr)
Definition: parse_tree_column_attrs.h:271
Sql_check_constraint_spec col_cc_spec
Definition: parse_tree_column_attrs.h:268
bool do_contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:293
Node for the COLLATE <collation> column attribute.
Definition: parse_tree_column_attrs.h:347
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:364
bool apply_collation(Column_parse_context *pc, const CHARSET_INFO **to, bool *has_explicit_collation) const override
Definition: parse_tree_column_attrs.h:354
PT_collate_column_attr(const POS &pos, const CHARSET_INFO *collation)
Definition: parse_tree_column_attrs.h:349
const CHARSET_INFO *const m_collation
Definition: parse_tree_column_attrs.h:367
Base class for all column attributes in CREATE/ALTER TABLE
Definition: parse_tree_column_attrs.h:86
decltype(Alter_info::flags) alter_info_flags_t
Definition: parse_tree_column_attrs.h:115
virtual bool is_constraint_enforced() const
Check if constraint is enforced.
Definition: parse_tree_column_attrs.h:153
virtual bool set_constraint_enforcement(bool enforced)
Update the ENFORCED/NOT ENFORCED state of the CHECK constraint.
Definition: parse_tree_column_attrs.h:163
virtual void apply_alter_info_flags(ulonglong *) const
Definition: parse_tree_column_attrs.h:118
virtual void apply_srid_modifier(std::optional< gis::srid_t > *) const
Definition: parse_tree_column_attrs.h:124
virtual bool apply_collation(Column_parse_context *, const CHARSET_INFO **to, bool *has_explicit_collation) const
Definition: parse_tree_column_attrs.h:125
virtual void apply_gen_default_value(Value_generator **)
Definition: parse_tree_column_attrs.h:121
Attr_type
Definition: parse_tree_column_attrs.h:92
@ AT_CONSTRAINT_ENFORCEMENT_ATTR
Definition: parse_tree_column_attrs.h:103
@ AT_SECONDARY_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:97
@ AT_CHECK_CONSTRAINT_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:102
@ AT_DEFAULT_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:95
@ AT_MASKING_POLICY_NAME_ATTR
Definition: parse_tree_column_attrs.h:112
@ AT_UNIQUE_KEY_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:100
@ AT_COMMENT_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:104
@ AT_PRIMARY_KEY_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:101
@ AT_GENERATED_DEFAULT_VAL_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:96
@ AT_SERIAL_DEFAULT_VALUE_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:107
@ AT_ON_UPDATE_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:105
@ AT_NULL_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:99
@ AT_NOT_NULL_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:98
@ AT_AUTO_INCREMENT_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:106
@ AT_COLUMN_FORMAT_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:108
@ AT_COLUMN_VISIBILITY_ATTR
Definition: parse_tree_column_attrs.h:111
@ AT_STORAGE_MEDIA_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:109
@ AT_COLLATE_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:94
@ AT_SRID_COLUMN_ATTR
Definition: parse_tree_column_attrs.h:110
@ AT_NONE
Definition: parse_tree_column_attrs.h:93
virtual Attr_type attr_type() const
Definition: parse_tree_column_attrs.h:135
PT_column_attr_base(const POS &pos)
Definition: parse_tree_column_attrs.h:88
virtual void apply_on_update_value(Item **) const
Definition: parse_tree_column_attrs.h:123
virtual void apply_type_flags(ulong *) const
Definition: parse_tree_column_attrs.h:117
virtual void apply_comment(LEX_CSTRING *) const
Definition: parse_tree_column_attrs.h:119
virtual void apply_mask(LEX_CSTRING *)
Definition: parse_tree_column_attrs.h:122
virtual bool add_check_constraints(Sql_check_constraint_spec_list *check_const_list)
Definition: parse_tree_column_attrs.h:131
virtual bool has_constraint_enforcement() const
Check for the [NOT] ENFORCED characteristic.
Definition: parse_tree_column_attrs.h:143
virtual void apply_default_value(Item **) const
Definition: parse_tree_column_attrs.h:120
Node for the VISIBLE|INVISIBLE column attribute.
Definition: parse_tree_column_attrs.h:633
PT_column_visibility_attr(const POS &pos, bool is_visible)
Definition: parse_tree_column_attrs.h:637
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:634
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:644
void apply_type_flags(unsigned long *type_flags) const override
Definition: parse_tree_column_attrs.h:639
const bool m_is_visible
Definition: parse_tree_column_attrs.h:649
Node for the [NOT] ENFORCED column attribute.
Definition: parse_tree_column_attrs.h:308
bool has_constraint_enforcement() const override
Check for the [NOT] ENFORCED characteristic.
Definition: parse_tree_column_attrs.h:313
bool is_constraint_enforced() const override
Check if constraint is enforced.
Definition: parse_tree_column_attrs.h:315
PT_constraint_enforcement_attr(const POS &pos, bool enforced)
Definition: parse_tree_column_attrs.h:310
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:317
const bool m_enforced
Definition: parse_tree_column_attrs.h:322
Node for the DATE type.
Definition: parse_tree_column_attrs.h:869
PT_date_type(const POS &pos)
Definition: parse_tree_column_attrs.h:871
Node for the DEFAULT <expression> column attribute.
Definition: parse_tree_column_attrs.h:377
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:393
void apply_default_value(Item **value) const override
Definition: parse_tree_column_attrs.h:385
PT_default_column_attr(const POS &pos, Item *item)
Definition: parse_tree_column_attrs.h:383
bool do_contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:386
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:397
Item * item
Definition: parse_tree_column_attrs.h:380
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:378
Definition: parse_tree_column_attrs.h:957
PT_enum_type_tmpl(const POS &pos, List< String > *interval_list, const CHARSET_INFO *charset, bool force_binary)
Definition: parse_tree_column_attrs.h:965
List< String > *const interval_list
Definition: parse_tree_column_attrs.h:958
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:959
const bool force_binary
Definition: parse_tree_column_attrs.h:960
List< String > * get_interval_list() const override
Definition: parse_tree_column_attrs.h:978
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:974
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:975
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:962
Base class for both generated and regular column definitions.
Definition: parse_tree_column_attrs.h:1021
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_column_attrs.h:1053
bool contextualize_attrs(Column_parse_context *pc, Mem_root_array< PT_column_attr_base * > *attrs)
Definition: parse_tree_column_attrs.h:1092
LEX_CSTRING comment
Definition: parse_tree_column_attrs.h:1035
enum_field_types type
Definition: parse_tree_column_attrs.h:1026
decltype(Alter_info::flags) alter_info_flags_t
Definition: parse_tree_column_attrs.h:1023
Value_generator * gcol_info
Definition: parse_tree_column_attrs.h:1038
const CHARSET_INFO * charset
Definition: parse_tree_column_attrs.h:1030
LEX_CSTRING masking_policy
Definition: parse_tree_column_attrs.h:1041
List< String > * interval_list
Definition: parse_tree_column_attrs.h:1033
const char * dec
Definition: parse_tree_column_attrs.h:1029
bool has_explicit_collation
Definition: parse_tree_column_attrs.h:1031
Item * on_update_value
Definition: parse_tree_column_attrs.h:1037
std::optional< gis::srid_t > m_srid
Definition: parse_tree_column_attrs.h:1042
const char * length
Definition: parse_tree_column_attrs.h:1028
Parse_tree_node super
Definition: parse_tree_column_attrs.h:1022
bool is_overridden(Mem_root_array< PT_column_attr_base * > *attrs, PT_column_attr_base *cand)
Definition: parse_tree_column_attrs.h:1071
PT_type * type_node
Definition: parse_tree_column_attrs.h:1047
alter_info_flags_t alter_info_flags
Definition: parse_tree_column_attrs.h:1034
Item * default_value
Definition: parse_tree_column_attrs.h:1036
Value_generator * default_val_info
Holds the expression to generate default values.
Definition: parse_tree_column_attrs.h:1040
PT_field_def_base(const POS &pos, PT_type *type_node)
Definition: parse_tree_column_attrs.h:1049
Sql_check_constraint_spec_list * check_const_spec_list
Definition: parse_tree_column_attrs.h:1044
ulong type_flags
Definition: parse_tree_column_attrs.h:1027
uint uint_geom_type
Definition: parse_tree_column_attrs.h:1032
Base class for regular (non-generated) column definition nodes.
Definition: parse_tree_column_attrs.h:1136
PT_field_def_base super
Definition: parse_tree_column_attrs.h:1137
Mem_root_array< PT_column_attr_base * > * opt_attrs
Definition: parse_tree_column_attrs.h:1139
bool do_contextualize(Parse_context *pc_arg) override
Definition: parse_tree_column_attrs.h:1146
PT_field_def(const POS &pos, PT_type *type_node_arg, Mem_root_array< PT_column_attr_base * > *opt_attrs)
Definition: parse_tree_column_attrs.h:1142
Node for the generated default value, column attribute.
Definition: parse_tree_column_attrs.h:567
Value_generator m_default_value_expression
Definition: parse_tree_column_attrs.h:600
void apply_gen_default_value(Value_generator **default_value_expression) override
Definition: parse_tree_column_attrs.h:577
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:568
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:595
PT_generated_default_val_column_attr(const POS &pos, Item *expr)
Definition: parse_tree_column_attrs.h:571
bool do_contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:582
Base class for generated column definition nodes.
Definition: parse_tree_column_attrs.h:1161
Item * expr
Definition: parse_tree_column_attrs.h:1165
Mem_root_array< PT_column_attr_base * > * opt_attrs
Definition: parse_tree_column_attrs.h:1166
bool do_contextualize(Parse_context *pc_arg) override
Definition: parse_tree_column_attrs.h:1177
PT_field_def_base super
Definition: parse_tree_column_attrs.h:1162
PT_generated_field_def(const POS &pos, 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:1169
const Virtual_or_stored virtual_or_stored
Definition: parse_tree_column_attrs.h:1164
Node for the JSON type.
Definition: parse_tree_column_attrs.h:1010
PT_json_type(const POS &pos)
Definition: parse_tree_column_attrs.h:1012
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:1013
Node for the masking policy, column attribute.
Definition: parse_tree_column_attrs.h:604
LEX_CSTRING m_policy_name
Definition: parse_tree_column_attrs.h:625
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:620
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:605
bool do_contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:611
PT_masking_policy_name_column_attr(const POS &pos, LEX_CSTRING policy_name)
Definition: parse_tree_column_attrs.h:608
void apply_mask(LEX_CSTRING *masking_policy_name) override
Definition: parse_tree_column_attrs.h:616
Node for the NOT NULL column attribute.
Definition: parse_tree_column_attrs.h:189
PT_not_null_column_attr(const POS &pos)
Definition: parse_tree_column_attrs.h:191
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:196
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:192
Node for the NULL column attribute.
Definition: parse_tree_column_attrs.h:173
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:181
PT_null_column_attr(const POS &pos)
Definition: parse_tree_column_attrs.h:175
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:176
Node for numeric types.
Definition: parse_tree_column_attrs.h:687
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:733
PT_numeric_type(const POS &pos, THD *thd, Numeric_type type_arg, const char *length, const char *dec, ulong options)
Definition: parse_tree_column_attrs.h:695
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:692
const char * dec
Definition: parse_tree_column_attrs.h:689
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:729
const char * get_length() const override
Definition: parse_tree_column_attrs.h:732
PT_numeric_type(const POS &pos, THD *thd, Int_type type_arg, const char *length, ulong options)
Definition: parse_tree_column_attrs.h:714
ulong options
Definition: parse_tree_column_attrs.h:690
const char * length
Definition: parse_tree_column_attrs.h:688
Node for the UPDATE NOW[([<precision>])] column attribute.
Definition: parse_tree_column_attrs.h:405
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:427
PT_on_update_column_attr(const POS &pos, uint8 precision)
Definition: parse_tree_column_attrs.h:412
bool do_contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:416
const uint8 precision
Definition: parse_tree_column_attrs.h:408
void apply_on_update_value(Item **value) const override
Definition: parse_tree_column_attrs.h:414
Item * item
Definition: parse_tree_column_attrs.h:409
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:406
Node for the PRIMARY [KEY] column attribute.
Definition: parse_tree_column_attrs.h:243
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:252
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:248
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:256
PT_primary_key_column_attr(const POS &pos)
Definition: parse_tree_column_attrs.h:245
Node for the NOT SECONDARY column attribute.
Definition: parse_tree_column_attrs.h:204
PT_secondary_column_attr(const POS &pos)
Definition: parse_tree_column_attrs.h:206
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:212
void apply_type_flags(unsigned long *type_flags) const override
Definition: parse_tree_column_attrs.h:208
Node for the SERIAL DEFAULT VALUE column attribute.
Definition: parse_tree_column_attrs.h:463
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:472
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:464
bool do_contextualize(Column_parse_context *pc) override
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_column_attrs.h:475
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:469
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:483
PT_serial_default_value_column_attr(const POS &pos)
Definition: parse_tree_column_attrs.h:467
Definition: parse_tree_column_attrs.h:995
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:999
bool is_serial_type() const override
Definition: parse_tree_column_attrs.h:1002
PT_serial_type(const POS &pos)
Definition: parse_tree_column_attrs.h:997
Node for spatial types.
Definition: parse_tree_column_attrs.h:942
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:949
Field::geometry_type geo_type
Definition: parse_tree_column_attrs.h:943
PT_spacial_type(const POS &pos, Field::geometry_type geo_type)
Definition: parse_tree_column_attrs.h:946
uint get_uint_geom_type() const override
Definition: parse_tree_column_attrs.h:950
const char * get_length() const override
Definition: parse_tree_column_attrs.h:951
Node for the SRID column attribute.
Definition: parse_tree_column_attrs.h:550
PT_srid_column_attr(const POS &pos, gis::srid_t srid)
Definition: parse_tree_column_attrs.h:556
void apply_srid_modifier(std::optional< gis::srid_t > *srid) const override
Definition: parse_tree_column_attrs.h:559
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:563
gis::srid_t m_srid
Definition: parse_tree_column_attrs.h:553
PT_column_attr_base super
Definition: parse_tree_column_attrs.h:551
Node for the TIME, TIMESTAMP and DATETIME types.
Definition: parse_tree_column_attrs.h:884
PT_time_type(const POS &pos, Time_type time_type, const char *dec)
Definition: parse_tree_column_attrs.h:890
const char * dec
Definition: parse_tree_column_attrs.h:885
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:893
std::remove_const< decltype(PT_type::type)>::type Parent_type
Definition: parse_tree_column_attrs.h:887
Node for the TIMESTAMP type.
Definition: parse_tree_column_attrs.h:901
ulong type_flags
Definition: parse_tree_column_attrs.h:905
const char * dec
Definition: parse_tree_column_attrs.h:904
const char * get_dec() const override
Definition: parse_tree_column_attrs.h:911
bool do_contextualize(Parse_context *pc) override
Definition: parse_tree_column_attrs.h:914
ulong get_type_flags() const override
Definition: parse_tree_column_attrs.h:912
PT_timestamp_type(const POS &pos, const char *dec)
Definition: parse_tree_column_attrs.h:908
PT_type super
Definition: parse_tree_column_attrs.h:902
Base class for all column type nodes.
Definition: parse_tree_column_attrs.h:659
virtual bool is_serial_type() const
Definition: parse_tree_column_attrs.h:674
virtual ulong get_type_flags() const
Definition: parse_tree_column_attrs.h:668
virtual const char * get_length() const
Definition: parse_tree_column_attrs.h:669
virtual const CHARSET_INFO * get_charset() const
Definition: parse_tree_column_attrs.h:671
virtual List< String > * get_interval_list() const
Definition: parse_tree_column_attrs.h:673
const enum_field_types type
Definition: parse_tree_column_attrs.h:661
virtual uint get_uint_geom_type() const
Definition: parse_tree_column_attrs.h:672
PT_type(const POS &pos, enum_field_types type)
Definition: parse_tree_column_attrs.h:664
virtual const char * get_dec() const
Definition: parse_tree_column_attrs.h:670
Node for the UNIQUE [KEY] column attribute.
Definition: parse_tree_column_attrs.h:220
enum Attr_type attr_type() const override
Definition: parse_tree_column_attrs.h:233
void apply_alter_info_flags(ulonglong *flags) const override
Definition: parse_tree_column_attrs.h:229
PT_unique_key_column_attr(const POS &pos)
Definition: parse_tree_column_attrs.h:222
void apply_type_flags(ulong *type_flags) const override
Definition: parse_tree_column_attrs.h:225
Definition: parse_tree_column_attrs.h:796
char vector_length_buffer[33]
Definition: parse_tree_column_attrs.h:797
PT_vector_type(const POS &pos, const char *length)
Definition: parse_tree_column_attrs.h:800
const char * get_length() const override
Definition: parse_tree_column_attrs.h:807
const CHARSET_INFO * get_charset() const override
Definition: parse_tree_column_attrs.h:808
Node for the YEAR type.
Definition: parse_tree_column_attrs.h:859
PT_year_type(const POS &pos)
Definition: parse_tree_column_attrs.h:861
Base class for parse tree nodes (excluding the Parse_tree_root hierarchy)
Definition: parse_tree_node_base.h:231
virtual bool contextualize(Context *pc) final
Definition: parse_tree_node_base.h:321
virtual bool do_contextualize(Column_parse_context *pc)
Do all context-sensitive things and mark the node as contextualized.
Definition: parse_tree_node_base.h:284
POS m_pos
Definition: parse_tree_node_base.h:245
This class represents a query block, aka a query specification, which is a query consisting of a SELE...
Definition: sql_lex.h:1179
Class to represent the check constraint specifications obtained from the SQL statement parse.
Definition: sql_check_constraint.h:43
Item * check_expr
Check constraint expression.
Definition: sql_check_constraint.h:80
bool is_enforced
Check constraint state (enforced/not enforced)
Definition: sql_check_constraint.h:86
LEX_STRING name
Name of the check constraint.
Definition: sql_check_constraint.h:77
@ SL_WARNING
Definition: sql_error.h:66
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:169
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
LEX * lex
Definition: sql_class.h:1006
void syntax_error_at(const POS &location)
Definition: sql_class.h:4557
System_variables variables
Definition: sql_lexer_thd.h:64
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:2685
MEM_ROOT * mem_root
Definition: sql_lexer_thd.h:40
Used for storing information associated with generated column, default values generated from expressi...
Definition: field.h:481
void set_field_stored(bool stored)
Definition: field.h:534
void set_field_type(enum_field_types fld_type)
Definition: field.h:517
Item * expr_item
Item representing the generation expression.
Definition: field.h:491
Mem_root_array< Sql_check_constraint_spec * > Sql_check_constraint_spec_list
Definition: dd_table.h:50
const char * ER_THD(const THD *thd, int mysql_errno)
Definition: derror.cc:104
This file contains the field type.
enum_field_types
Column types for MySQL Note: Keep include/mysql/components/services/bits/stored_program_bits....
Definition: field_types.h:55
@ MYSQL_TYPE_TIME2
Internal to MySQL.
Definition: field_types.h:75
@ MYSQL_TYPE_VARCHAR
Definition: field_types.h:71
@ MYSQL_TYPE_LONGLONG
Definition: field_types.h:64
@ MYSQL_TYPE_LONG_BLOB
Definition: field_types.h:86
@ MYSQL_TYPE_BLOB
Definition: field_types.h:87
@ MYSQL_TYPE_TINY
Definition: field_types.h:57
@ MYSQL_TYPE_SET
Definition: field_types.h:83
@ MYSQL_TYPE_VECTOR
Definition: field_types.h:77
@ MYSQL_TYPE_JSON
Definition: field_types.h:80
@ MYSQL_TYPE_STRING
Definition: field_types.h:89
@ MYSQL_TYPE_ENUM
Definition: field_types.h:82
@ MYSQL_TYPE_TINY_BLOB
Definition: field_types.h:84
@ MYSQL_TYPE_BIT
Definition: field_types.h:72
@ MYSQL_TYPE_INVALID
Definition: field_types.h:78
@ MYSQL_TYPE_GEOMETRY
Definition: field_types.h:90
@ MYSQL_TYPE_MEDIUM_BLOB
Definition: field_types.h:85
@ MYSQL_TYPE_DATETIME2
Internal to MySQL.
Definition: field_types.h:74
@ MYSQL_TYPE_DATE
Definition: field_types.h:66
@ MYSQL_TYPE_TIMESTAMP2
Definition: field_types.h:73
@ MYSQL_TYPE_YEAR
Definition: field_types.h:69
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:7397
void my_error(int nr, myf MyFlags,...)
Fill in and print a previously registered error message.
Definition: my_error.cc:217
#define PRI_KEY_FLAG
Field is part of a primary key.
Definition: mysql_com.h:155
#define FIELD_FLAGS_COLUMN_FORMAT
Field column format, bit 24-25.
Definition: mysql_com.h:186
#define ZEROFILL_FLAG
Field is zerofill.
Definition: mysql_com.h:160
#define UNSIGNED_FLAG
Field is unsigned.
Definition: mysql_com.h:159
#define UNIQUE_FLAG
Intern: Used by sql_yacc.
Definition: mysql_com.h:172
#define AUTO_INCREMENT_FLAG
field is a autoincrement field
Definition: mysql_com.h:165
#define FIELD_FLAGS_COLUMN_FORMAT_MASK
Definition: mysql_com.h:187
#define NOT_NULL_FLAG
Field can't be NULL.
Definition: mysql_com.h:154
#define BINCMP_FLAG
Intern: Used by sql_yacc.
Definition: mysql_com.h:173
#define FIELD_IS_INVISIBLE
Field is explicitly marked as invisible by the user.
Definition: mysql_com.h:199
#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:197
#define FIELD_FLAGS_STORAGE_MEDIA
Field storage media, bit 22-23.
Definition: mysql_com.h:184
static int flags[50]
Definition: hp_test1.cc:40
constexpr const LEX_CSTRING EMPTY_CSTR
Definition: lex_string.h:49
A better implementation of the UNIX ctype(3) library.
MYSQL_STRINGS_EXPORT CHARSET_INFO my_charset_bin
Definition: ctype-bin.cc:499
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:116
Header for compiler-dependent features.
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
uint8_t uint8
Definition: my_inttypes.h:63
#define MYF(v)
Definition: my_inttypes.h:97
Common header for many mysys elements.
Common definition between mysql server & client.
const char * collation
Definition: audit_api_message_emit.cc:184
bool length(const dd::Spatial_reference_system *srs, const Geometry *g1, double *length, bool *null) noexcept
Computes the length of linestrings and multilinestrings.
Definition: length.cc:76
std::uint32_t srid_t
A spatial reference system ID (SRID).
Definition: srid.h:33
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
Definition: options.cc:57
Blob_type
Definition: parse_tree_column_attrs.h:811
Enum_type
Definition: parse_tree_column_attrs.h:954
Char_type
Definition: parse_tree_column_attrs.h:764
PT_enum_type_tmpl< Enum_type::ENUM > PT_enum_type
Node for the ENUM type.
Definition: parse_tree_column_attrs.h:986
PT_enum_type_tmpl< Enum_type::SET > PT_set_type
Node for the SET type.
Definition: parse_tree_column_attrs.h:993
Time_type
Definition: parse_tree_column_attrs.h:874
void move_cf_appliers(Parse_context *tddlpc, Column_parse_context *cpc)
Definition: parse_tree_helpers.cc:439
Int_type
Definition: parser_yystype.h:254
Numeric_type
Definition: parser_yystype.h:262
Virtual_or_stored
Definition: parser_yystype.h:252
@ enum_type
ENUM, stored in the backend data as long long.
Definition: row_proxy.h:47
column_format_type
Definition: field.h:188
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:704
bool check_masking_policy_name(LEX_CSTRING name)
Check if the name is valid for a masking policy name or a masking policy argument name.
Definition: sql_masking_policy.cc:324
case opt name
Definition: sslopt-case.h:29
Definition: m_ctype.h:421
Parse context for column type attribute specific parse tree nodes.
Definition: parse_tree_column_attrs.h:74
const bool is_generated
Owner column is a generated one.
Definition: parse_tree_column_attrs.h:75
std::vector< CreateFieldApplier > cf_appliers
Definition: parse_tree_column_attrs.h:76
Column_parse_context(THD *thd_arg, Query_block *select_arg, bool is_generated)
Definition: parse_tree_column_attrs.h:77
bool binlog_need_explicit_defaults_ts
Definition: sql_lex.h:4651
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35
Bison "location" class.
Definition: parse_location.h:43
Environment data for the contextualization phase.
Definition: parse_tree_node_base.h:422
Query_block * select
Current Query_block object.
Definition: parse_tree_node_base.h:425
THD *const thd
Current thread handler.
Definition: parse_tree_node_base.h:423
MEM_ROOT * mem_root
Current MEM_ROOT.
Definition: parse_tree_node_base.h:424