1#ifndef SQL_CREATE_FIELD_INCLUDED
2#define SQL_CREATE_FIELD_INCLUDED
75 size_t pack_length(
bool dont_override =
false)
const;
221 Item *default_value,
Item *on_update_value,
224 bool has_explicit_collation, uint uint_geom_type,
226 std::optional<gis::srid_t> srid,
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:251
Create_field is a description a field/column that may or may not exists in a table.
Definition: create_field.h:51
const char * change
Name of column modified by ALTER TABLE's CHANGE/MODIFY COLUMN clauses, NULL for columns added.
Definition: create_field.h:99
bool treat_bit_as_char
Indicates that storage engine doesn't support optimized BIT field storage.
Definition: create_field.h:152
bool stored_in_db
Definition: create_field.h:174
size_t max_display_width_in_codepoints() const
Definition: create_field.cc:638
TYPELIB * interval
Definition: create_field.h:122
ha_storage_media field_storage_type() const
Definition: create_field.h:229
uint decimals
Definition: create_field.h:113
Value_generator * gcol_info
Definition: create_field.h:168
Value_generator * m_default_val_expr
Holds the expression to be used to generate default values.
Definition: create_field.h:177
bool is_zerofill
Definition: create_field.h:139
dd::Column::enum_hidden_type hidden
Definition: create_field.h:92
uint pack_length_override
Row based replication code sometimes needs to create ENUM and SET fields with pack length which doesn...
Definition: create_field.h:165
uint flags
Definition: create_field.h:114
bool is_explicit_collation
Definition: create_field.h:126
size_t key_length() const
Definition: create_field.cc:758
const CHARSET_INFO * charset
Definition: create_field.h:125
const char * field_name
Definition: create_field.h:94
bool is_virtual_gcol() const
Definition: create_field.h:209
List< String > interval_list
Definition: create_field.h:124
LEX_CSTRING m_engine_attribute
Definition: create_field.h:183
bool is_unsigned
Definition: create_field.h:140
bool explicit_display_width() const
Definition: create_field.h:83
Create_field()
Definition: create_field.h:186
uint offset
Definition: create_field.h:130
bool is_gcol() const
Definition: create_field.h:208
const char * after
Definition: create_field.h:100
void init_for_tmp_table(enum_field_types sql_type_arg, uint32 max_length, uint32 decimals, bool is_nullable, bool is_unsigned, uint pack_length_override, const char *field_name="")
Init for a tmp table field.
Definition: create_field.cc:581
Field::geometry_type geom_type
Definition: create_field.h:127
uchar auto_flags
Bitmap of flags indicating if field value should be auto-generated by default and/or on update,...
Definition: create_field.h:121
size_t pack_length(bool dont_override=false) const
Definition: create_field.cc:726
column_format_type column_format() const
Definition: create_field.h:233
Create_field * clone(MEM_ROOT *mem_root) const
Definition: create_field.h:205
size_t max_display_width_in_bytes() const
Definition: create_field.cc:685
bool init(THD *thd, const char *field_name, enum_field_types type, const char *length, const char *decimals, uint type_modifier, Item *default_value, Item *on_update_value, const LEX_CSTRING *comment, const char *change, List< String > *interval_list, const CHARSET_INFO *cs, bool has_explicit_collation, uint uint_geom_type, Value_generator *gcol_info, Value_generator *default_val_expr, std::optional< gis::srid_t > srid, dd::Column::enum_hidden_type hidden, bool is_array=false)
Initialize a column definition object.
Definition: create_field.cc:197
bool is_array
Definition: create_field.h:181
bool m_explicit_display_width
Whether or not the display width was given explicitly by the user.
Definition: create_field.h:261
size_t m_max_display_width_in_codepoints
The maximum display width of this column.
Definition: create_field.h:258
Field * field
Definition: create_field.h:128
bool is_nullable
Indicate whether column is nullable, zerofill or unsigned.
Definition: create_field.h:138
Item * constant_default
The declared default value, if any, otherwise NULL.
Definition: create_field.h:111
LEX_CSTRING comment
Definition: create_field.h:101
std::optional< gis::srid_t > m_srid
Definition: create_field.h:178
enum_field_types sql_type
Definition: create_field.h:112
LEX_CSTRING m_secondary_engine_attribute
Definition: create_field.h:184
void set_max_display_width_from_create_field(const Create_field &create_field)
Set the maximum display width based on another Create_field.
Definition: create_field.h:86
@ NONE
Definition: field.h:711
geometry_type
Definition: field.h:718
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:936
Definition: sql_list.h:467
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Used for storing information associated with generated column, default values generated from expressi...
Definition: field.h:483
bool get_field_stored() const
Definition: field.h:535
enum_hidden_type
Definition: column.h:95
static MEM_ROOT mem_root
Definition: client_plugin.cc:114
bool is_field_for_functional_index(const Create_field *create_field)
Definition: create_field.cc:788
bool is_hidden_by_user(const Create_field *create_field)
Definition: create_field.cc:797
bool is_hidden_by_system(const Create_field *create_field)
Definition: create_field.cc:792
column_format_type
Definition: field.h:190
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
#define FIELD_FLAGS_COLUMN_FORMAT
Field column format, bit 24-25.
Definition: mysql_com.h:187
#define FIELD_FLAGS_STORAGE_MEDIA
Field storage media, bit 22-23.
Definition: mysql_com.h:185
constexpr const LEX_CSTRING EMPTY_CSTR
Definition: lex_string.h:48
A better implementation of the UNIX ctype(3) library.
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
unsigned char uchar
Definition: my_inttypes.h:52
uint32_t uint32
Definition: my_inttypes.h:67
Definition: commit_order_queue.h:34
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
required string type
Definition: replication_group_member_actions.proto:34
Definition: m_ctype.h:423
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:83
Definition: mysql_lex_string.h:40