23#ifndef KEY_SPEC_INCLUDED
24#define KEY_SPEC_INCLUDED
234 while ((column = it++))
columns.push_back(column);
284 while ((ref_column = it++))
ref_columns.push_back(ref_column);
Kerberos Client Authentication nullptr
Definition: auth_kerberos_client_plugin.cc:250
Create_field is a description a field/column that may or may not exists in a table.
Definition: create_field.h:50
Definition: key_spec.h:240
const LEX_CSTRING ref_db
Definition: key_spec.h:242
const bool has_explicit_name
Indicates whether foreign key name was provided explicitly or was generated automatically.
Definition: key_spec.h:258
const LEX_CSTRING orig_ref_db
Definition: key_spec.h:243
const fk_option update_opt
Definition: key_spec.h:248
bool validate(THD *thd, const char *table_name, List< Create_field > &table_fields) const
Check if the foreign key name has valid length and its options are compatible with columns on which t...
Definition: key_spec.cc:106
const LEX_CSTRING orig_ref_table
Definition: key_spec.h:245
Mem_root_array< Key_part_spec * > ref_columns
Definition: key_spec.h:246
const fk_option delete_opt
Definition: key_spec.h:247
const fk_match_opt match_opt
Definition: key_spec.h:249
const LEX_CSTRING ref_table
Definition: key_spec.h:244
Foreign_key_spec(MEM_ROOT *mem_root, const LEX_CSTRING &name_arg, List< Key_part_spec > cols, const LEX_CSTRING &ref_db_arg, const LEX_CSTRING &orig_ref_db_arg, const LEX_CSTRING &ref_table_arg, const LEX_CSTRING &orig_ref_table_arg, List< Key_part_spec > *ref_cols, fk_option delete_opt_arg, fk_option update_opt_arg, fk_match_opt match_opt_arg)
Definition: key_spec.h:260
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:932
Definition: key_spec.h:66
bool is_algorithm_explicit
A flag which indicates that index algorithm was explicitly specified by user.
Definition: key_spec.h:73
ulong block_size
Definition: key_spec.h:74
LEX_CSTRING m_secondary_engine_attribute
Definition: key_spec.h:84
LEX_CSTRING m_engine_attribute
Definition: key_spec.h:83
KEY_CREATE_INFO()=default
LEX_CSTRING parser_name
Definition: key_spec.h:75
KEY_CREATE_INFO(bool is_visible_arg)
Definition: key_spec.h:81
bool is_visible
Definition: key_spec.h:77
LEX_CSTRING comment
Definition: key_spec.h:76
enum ha_key_alg algorithm
Definition: key_spec.h:68
Definition: key_spec.h:89
const bool m_is_explicit
true <=> ASC/DESC is explicitly specified, false <=> implicit ASC
Definition: key_spec.h:186
Key_part_spec * clone(MEM_ROOT *mem_root) const
Construct a copy of this Key_part_spec.
Definition: key_spec.h:125
void set_name_and_prefix_length(const char *name, uint prefix_length)
Set the name and the prefix length of the column this key part references.
Definition: key_spec.cc:100
uint get_prefix_length() const
Definition: key_spec.h:131
bool has_expression() const
Definition: key_spec.h:179
const char * get_field_name() const
Definition: key_spec.h:129
Item * get_expression() const
Definition: key_spec.h:133
const char * m_field_name
The name of the column that this key part points to.
Definition: key_spec.h:189
Key_part_spec(Item *expression, enum_order order)
Definition: key_spec.h:91
uint m_prefix_length
The prefix length of this index.
Definition: key_spec.h:192
bool is_explicit() const
Definition: key_spec.h:149
bool operator==(const Key_part_spec &other) const
Definition: key_spec.cc:49
bool m_has_expression
Whether this key part has an expression or not.
Definition: key_spec.h:204
bool resolve_expression(THD *thd)
Resolve the expression that this key part contains.
Definition: key_spec.cc:90
Item * m_expression
The indexed expression if this is a functional key part.
Definition: key_spec.h:198
Key_part_spec(const char *column_name, Item *expression, enum_order order)
Definition: key_spec.h:99
Key_part_spec(LEX_CSTRING column_name, uint prefix_length, enum_order order)
Definition: key_spec.h:107
const bool m_is_ascending
true <=> ascending, false <=> descending.
Definition: key_spec.h:183
bool is_ascending() const
Definition: key_spec.h:142
Definition: key_spec.h:207
Key_spec(MEM_ROOT *mem_root, keytype type_par, const LEX_CSTRING &name_arg, const KEY_CREATE_INFO *key_info_arg, bool generated_arg, bool check_for_duplicate_indexes_arg, List< Key_part_spec > &cols)
Definition: key_spec.h:222
virtual ~Key_spec()=default
const KEY_CREATE_INFO key_create_info
Definition: key_spec.h:210
const keytype type
Definition: key_spec.h:209
Mem_root_array< Key_part_spec * > columns
Definition: key_spec.h:211
LEX_CSTRING name
Definition: key_spec.h:212
const bool generated
Definition: key_spec.h:213
const bool check_for_duplicate_indexes
A flag to determine if we will check for duplicate indexes.
Definition: key_spec.h:220
Definition: sql_list.h:572
Definition: sql_list.h:433
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:425
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:35
uint elements
Definition: sql_list.h:135
static MEM_ROOT mem_root
Definition: client_plugin.cc:113
fk_match_opt
Definition: key_spec.h:57
@ FK_MATCH_UNDEF
Definition: key_spec.h:58
@ FK_MATCH_SIMPLE
Definition: key_spec.h:61
@ FK_MATCH_FULL
Definition: key_spec.h:59
@ FK_MATCH_PARTIAL
Definition: key_spec.h:60
KEY_CREATE_INFO default_key_create_info
Definition: key_spec.cc:47
enum_order
Definition: key_spec.h:64
@ ORDER_NOT_RELEVANT
Definition: key_spec.h:64
@ ORDER_ASC
Definition: key_spec.h:64
@ ORDER_DESC
Definition: key_spec.h:64
keytype
Definition: key_spec.h:39
@ KEYTYPE_FULLTEXT
Definition: key_spec.h:43
@ KEYTYPE_FOREIGN
Definition: key_spec.h:45
@ KEYTYPE_PRIMARY
Definition: key_spec.h:40
@ KEYTYPE_MULTIPLE
Definition: key_spec.h:42
@ KEYTYPE_SPATIAL
Definition: key_spec.h:44
@ KEYTYPE_UNIQUE
Definition: key_spec.h:41
bool foreign_key_prefix(const Key_spec *a, const Key_spec *b)
Test if a foreign key (= generated key) is a prefix of the given key (ignoring key name,...
Definition: key_spec.cc:56
fk_option
Definition: key_spec.h:48
@ FK_OPTION_DEFAULT
Definition: key_spec.h:54
@ FK_OPTION_SET_NULL
Definition: key_spec.h:52
@ FK_OPTION_UNDEF
Definition: key_spec.h:49
@ FK_OPTION_RESTRICT
Definition: key_spec.h:50
@ FK_OPTION_CASCADE
Definition: key_spec.h:51
@ FK_OPTION_NO_ACTION
Definition: key_spec.h:53
constexpr const LEX_CSTRING EMPTY_CSTR
Definition: lex_string.h:47
This file includes constants used by all storage engines.
ha_key_alg
Definition: my_base.h:96
@ HA_KEY_ALG_SE_SPECIFIC
Used for cases when key algorithm which is supported by SE can't be described by one of other classes...
Definition: my_base.h:105
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1085
const char * table_name
Definition: rules_table_service.cc:55
#define NullS
Definition of the null string (a null pointer of type char *), used in some of our string handling co...
Definition: nulls.h:32
case opt name
Definition: sslopt-case.h:32
The MEM_ROOT is a simple arena, where allocations are carved out of larger blocks.
Definition: my_alloc.h:82
Definition: mysql_lex_string.h:39