24#ifndef KEY_SPEC_INCLUDED
25#define KEY_SPEC_INCLUDED
235 while ((column = it++))
columns.push_back(column);
285 while ((ref_column = it++))
ref_columns.push_back(ref_column);
Create_field is a description a field/column that may or may not exists in a table.
Definition: create_field.h:51
Definition: key_spec.h:241
const LEX_CSTRING ref_db
Definition: key_spec.h:243
const bool has_explicit_name
Indicates whether foreign key name was provided explicitly or was generated automatically.
Definition: key_spec.h:259
const LEX_CSTRING orig_ref_db
Definition: key_spec.h:244
const fk_option update_opt
Definition: key_spec.h:249
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:107
const LEX_CSTRING orig_ref_table
Definition: key_spec.h:246
Mem_root_array< Key_part_spec * > ref_columns
Definition: key_spec.h:247
const fk_option delete_opt
Definition: key_spec.h:248
const fk_match_opt match_opt
Definition: key_spec.h:250
const LEX_CSTRING ref_table
Definition: key_spec.h:245
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:261
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:853
Definition: key_spec.h:67
bool is_algorithm_explicit
A flag which indicates that index algorithm was explicitly specified by user.
Definition: key_spec.h:74
ulong block_size
Definition: key_spec.h:75
LEX_CSTRING m_secondary_engine_attribute
Definition: key_spec.h:85
LEX_CSTRING m_engine_attribute
Definition: key_spec.h:84
KEY_CREATE_INFO()=default
LEX_CSTRING parser_name
Definition: key_spec.h:76
KEY_CREATE_INFO(bool is_visible_arg)
Definition: key_spec.h:82
bool is_visible
Definition: key_spec.h:78
LEX_CSTRING comment
Definition: key_spec.h:77
enum ha_key_alg algorithm
Definition: key_spec.h:69
Definition: key_spec.h:90
const bool m_is_explicit
true <=> ASC/DESC is explicitly specified, false <=> implicit ASC
Definition: key_spec.h:187
Key_part_spec * clone(MEM_ROOT *mem_root) const
Construct a copy of this Key_part_spec.
Definition: key_spec.h:126
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:101
uint get_prefix_length() const
Definition: key_spec.h:132
bool has_expression() const
Definition: key_spec.h:180
const char * get_field_name() const
Definition: key_spec.h:130
Item * get_expression() const
Definition: key_spec.h:134
const char * m_field_name
The name of the column that this key part points to.
Definition: key_spec.h:190
Key_part_spec(Item *expression, enum_order order)
Definition: key_spec.h:92
uint m_prefix_length
The prefix length of this index.
Definition: key_spec.h:193
bool is_explicit() const
Definition: key_spec.h:150
bool operator==(const Key_part_spec &other) const
Definition: key_spec.cc:50
bool m_has_expression
Whether this key part has an expression or not.
Definition: key_spec.h:205
bool resolve_expression(THD *thd)
Resolve the expression that this key part contains.
Definition: key_spec.cc:91
Item * m_expression
The indexed expression if this is a functional key part.
Definition: key_spec.h:199
Key_part_spec(const char *column_name, Item *expression, enum_order order)
Definition: key_spec.h:100
Key_part_spec(LEX_CSTRING column_name, uint prefix_length, enum_order order)
Definition: key_spec.h:108
const bool m_is_ascending
true <=> ascending, false <=> descending.
Definition: key_spec.h:184
bool is_ascending() const
Definition: key_spec.h:143
Definition: key_spec.h:208
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:223
virtual ~Key_spec()=default
const KEY_CREATE_INFO key_create_info
Definition: key_spec.h:211
const keytype type
Definition: key_spec.h:210
Mem_root_array< Key_part_spec * > columns
Definition: key_spec.h:212
LEX_CSTRING name
Definition: key_spec.h:213
const bool generated
Definition: key_spec.h:214
const bool check_for_duplicate_indexes
A flag to determine if we will check for duplicate indexes.
Definition: key_spec.h:221
Definition: sql_list.h:573
Definition: sql_list.h:434
A typesafe replacement for DYNAMIC_ARRAY.
Definition: mem_root_array.h:426
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
uint elements
Definition: sql_list.h:136
static MEM_ROOT mem_root
Definition: client_plugin.cc:110
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
fk_match_opt
Definition: key_spec.h:58
@ FK_MATCH_UNDEF
Definition: key_spec.h:59
@ FK_MATCH_SIMPLE
Definition: key_spec.h:62
@ FK_MATCH_FULL
Definition: key_spec.h:60
@ FK_MATCH_PARTIAL
Definition: key_spec.h:61
KEY_CREATE_INFO default_key_create_info
Definition: key_spec.cc:48
enum_order
Definition: key_spec.h:65
@ ORDER_NOT_RELEVANT
Definition: key_spec.h:65
@ ORDER_ASC
Definition: key_spec.h:65
@ ORDER_DESC
Definition: key_spec.h:65
keytype
Definition: key_spec.h:40
@ KEYTYPE_FULLTEXT
Definition: key_spec.h:44
@ KEYTYPE_FOREIGN
Definition: key_spec.h:46
@ KEYTYPE_PRIMARY
Definition: key_spec.h:41
@ KEYTYPE_MULTIPLE
Definition: key_spec.h:43
@ KEYTYPE_SPATIAL
Definition: key_spec.h:45
@ KEYTYPE_UNIQUE
Definition: key_spec.h:42
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:57
fk_option
Definition: key_spec.h:49
@ FK_OPTION_DEFAULT
Definition: key_spec.h:55
@ FK_OPTION_SET_NULL
Definition: key_spec.h:53
@ FK_OPTION_UNDEF
Definition: key_spec.h:50
@ FK_OPTION_RESTRICT
Definition: key_spec.h:51
@ FK_OPTION_CASCADE
Definition: key_spec.h:52
@ FK_OPTION_NO_ACTION
Definition: key_spec.h:54
constexpr const LEX_CSTRING EMPTY_CSTR
Definition: lex_string.h:48
#define NullS
Definition of the null string (a null pointer of type char *), used in some of our string handling co...
Definition: m_string.h:53
This file includes constants used by all storage engines.
ha_key_alg
Definition: my_base.h:97
@ 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:106
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1052
const char * table_name
Definition: rules_table_service.cc:56
case opt name
Definition: sslopt-case.h:33
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
unsigned int uint
Definition: uca9-dump.cc:75