#include <key_spec.h>
|
| 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) |
|
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 the FK is created. More...
|
|
bool | set_ref_columns_for_implicit_pk (THD *thd, bool is_self_referencing_fk, Mem_root_array< Key_spec * > &key_list) |
| Set referenced column list for a FK from the referenced table PK columns. More...
|
|
| 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) |
|
virtual | ~Key_spec ()=default |
|
◆ Foreign_key_spec()
Foreign_key_spec::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 |
|
) |
| |
|
inline |
◆ set_ref_columns_for_implicit_pk()
bool Foreign_key_spec::set_ref_columns_for_implicit_pk |
( |
THD * |
thd, |
|
|
bool |
is_self_referencing_fk, |
|
|
Mem_root_array< Key_spec * > & |
key_list |
|
) |
| |
Set referenced column list for a FK from the referenced table PK columns.
- Parameters
-
thd | Thread handle. |
is_self_referencing_fk | Represents self referencing foreign key. |
key_list | key info list of parent/referenced table. |
- Return values
-
false | when ref_columns list is populated successfully or when ref_columns list is empty since parent table or PK in parent table is missing. |
true | if any error |
◆ validate()
bool Foreign_key_spec::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 the FK is created.
- Parameters
-
thd | Thread handle |
table_name | Table name (for error reporting) |
table_fields | List of columns |
- Return values
-
false | Key valid |
true | Key invalid |
◆ delete_opt
◆ has_explicit_name
const bool Foreign_key_spec::has_explicit_name |
Indicates whether foreign key name was provided explicitly or was generated automatically.
- See also
- prepare_foreign_key().
◆ match_opt
◆ orig_ref_db
◆ orig_ref_table
◆ ref_columns
◆ ref_db
◆ ref_table
◆ update_opt
The documentation for this class was generated from the following files: