diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2020-12-07 18:02:31 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2020-12-08 07:12:33 +0300 |
commit | 4f34732e2b5168588ac9b718d5b6d0e5fc3fcb12 (patch) | |
tree | edb1d8291553971da8e545e5062ff261f5dc1631 | |
parent | 5782d2e2048592d83e547fda4f8a27a8a5bba7ea (diff) | |
download | mariadb-git-4f34732e2b5168588ac9b718d5b6d0e5fc3fcb12.tar.gz |
FK_ddl_vector renamed to FK_backup_storage
-rw-r--r-- | sql/datadict.cc | 8 | ||||
-rw-r--r-- | sql/handler.cc | 2 | ||||
-rw-r--r-- | sql/sql_alter.h | 2 | ||||
-rw-r--r-- | sql/sql_class.h | 5 | ||||
-rw-r--r-- | sql/sql_rename.cc | 10 | ||||
-rw-r--r-- | sql/sql_table.cc | 12 | ||||
-rw-r--r-- | sql/sql_table.h | 4 | ||||
-rw-r--r-- | sql/table.h | 4 | ||||
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 2 |
9 files changed, 24 insertions, 25 deletions
diff --git a/sql/datadict.cc b/sql/datadict.cc index 9369371f559..7d90f6c063a 100644 --- a/sql/datadict.cc +++ b/sql/datadict.cc @@ -666,7 +666,7 @@ void FK_backup::fk_drop_backup_frm(ddl_log_info &log_info) } -int FK_ddl_vector::write_shadow_frms() +int FK_backup_storage::write_shadow_frms() { int err; #ifndef DBUG_OFF @@ -694,7 +694,7 @@ int FK_ddl_vector::write_shadow_frms() } -bool FK_ddl_vector::install_shadow_frms() +bool FK_backup_storage::install_shadow_frms() { if (!size()) return false; @@ -738,7 +738,7 @@ bool FK_ddl_vector::install_shadow_frms() } -void FK_ddl_vector::rollback(THD *thd) +void FK_backup_storage::rollback(THD *thd) { for (auto &bak: *this) bak.second.rollback(*this); @@ -756,7 +756,7 @@ void FK_ddl_vector::rollback(THD *thd) } -void FK_ddl_vector::drop_backup_frms(THD *thd) +void FK_backup_storage::drop_backup_frms(THD *thd) { #ifndef DBUG_OFF dbg_fail= true; diff --git a/sql/handler.cc b/sql/handler.cc index 6555b992fd5..f6c877fc04b 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -5511,7 +5511,7 @@ int ha_create_table(THD *thd, const char *path, char name_buff[FN_REFLEN]; const char *name; TABLE_SHARE share; - FK_ddl_vector fk_shares; + FK_backup_storage fk_shares; bool temp_table __attribute__((unused)) = create_info->options & (HA_LEX_CREATE_TMP_TABLE | HA_CREATE_TMP_ALTER); DBUG_ENTER("ha_create_table"); diff --git a/sql/sql_alter.h b/sql/sql_alter.h index 74a7df9622d..6e38cc675c9 100644 --- a/sql/sql_alter.h +++ b/sql/sql_alter.h @@ -395,7 +395,7 @@ public: void fk_release_locks(THD *thd); // NB: shares are owned and released by fk_shares. - FK_ddl_vector fk_ref_backup; + FK_backup_storage fk_ref_backup; /* NB: backup is added only if not exists, fk_handle_alter() may try it multiple times per one share. diff --git a/sql/sql_class.h b/sql/sql_class.h index b98f13700f5..031780dd320 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1031,7 +1031,7 @@ class FK_ddl_backup : public FK_share_backup /* NB: if sa.share is not empty, share == sa.share. ALTER algorithms are more complex and shares are held and released in separate container alter_ctx.fk_shares. - To make DDL logging common for all commands we handle it via FK_ddl_vector interface, but + To make DDL logging common for all commands we handle it via FK_backup_storage interface, but without templating and virtual interfaces (these are overcomplexity for only 2 variations) we have to converge backup operations into single FK_ddl_backup. */ @@ -1064,8 +1064,7 @@ public: ifaces we just use mbd::map for everything. We are not going to hit bottleneck here: it is DDL (rare operation), it is less than hundred of foreign keys normally. */ -// FIXME: not a vector now, rename to something... -class FK_ddl_vector: public mbd::map<TABLE_SHARE *, FK_ddl_backup>, public ddl_log_info +class FK_backup_storage: public mbd::map<TABLE_SHARE *, FK_ddl_backup>, public ddl_log_info { public: int write_shadow_frms(); diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 08ea7597806..6e4abd181f7 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -34,13 +34,13 @@ static TABLE_LIST *rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error, bool if_exits, bool *force_if_exists, - FK_ddl_vector &fk_rename_backup); + FK_backup_storage &fk_rename_backup); static bool do_rename(THD *thd, TABLE_LIST *ren_table, const LEX_CSTRING *new_db, const LEX_CSTRING *new_table_name, const LEX_CSTRING *new_table_alias, bool skip_error, bool if_exists, bool *force_if_exists, - FK_ddl_vector &fk_rename_backup); + FK_backup_storage &fk_rename_backup); static TABLE_LIST *reverse_table_list(TABLE_LIST *table_list); @@ -57,7 +57,7 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list, bool silent, TABLE_LIST *ren_table= 0; int to_table; const char *rename_log_table[2]= {NULL, NULL}; - FK_ddl_vector fk_rename_backup; + FK_backup_storage fk_rename_backup; DBUG_ENTER("mysql_rename_tables"); /* @@ -314,7 +314,7 @@ do_rename(THD *thd, TABLE_LIST *ren_table, const LEX_CSTRING *new_db, const LEX_CSTRING *new_table_name, const LEX_CSTRING *new_table_alias, bool skip_error, bool if_exists, bool *force_if_exists, - FK_ddl_vector &fk_rename_backup) + FK_backup_storage &fk_rename_backup) { int rc= 1; handlerton *hton, *new_hton; @@ -479,7 +479,7 @@ do_rename(THD *thd, TABLE_LIST *ren_table, const LEX_CSTRING *new_db, static TABLE_LIST * rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error, bool if_exists, bool *force_if_exists, - FK_ddl_vector &fk_rename_backup) + FK_backup_storage &fk_rename_backup) { TABLE_LIST *ren_table, *new_table; DBUG_ENTER("rename_tables"); diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 521dc44593f..f14bf71705c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -90,7 +90,7 @@ static bool fix_constraints_names(THD *thd, List<Virtual_column_info> *check_constraint_list, const HA_CREATE_INFO *create_info); static -bool fk_handle_drop(THD* thd, TABLE_LIST* table, FK_ddl_vector& shares, +bool fk_handle_drop(THD* thd, TABLE_LIST* table, FK_backup_storage& shares, bool drop_db); /** @@ -2521,7 +2521,7 @@ int mysql_rm_table_no_locks(THD *thd, TABLE_LIST *tables, bool if_exists, goto err; } bool enoent_warning; - FK_ddl_vector shares; + FK_backup_storage shares; error= fk_handle_drop(thd, table, shares, drop_db); if (unlikely(error)) goto err; @@ -9993,7 +9993,7 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list, if (likely(!error) && alter_ctx->is_table_renamed()) { THD_STAGE_INFO(thd, stage_rename); - FK_ddl_vector fk_rename_backup; + FK_backup_storage fk_rename_backup; handlerton *old_db_type= table->s->db_type(); /* Then do a 'simple' rename of the table. First we need to close all @@ -12484,7 +12484,7 @@ wsrep_error_label: // Used in CREATE TABLE and in FK upgrade (fk_add != NULL) -bool TABLE_SHARE::fk_handle_create(THD *thd, FK_ddl_vector &shares, FK_list *fk_add) +bool TABLE_SHARE::fk_handle_create(THD *thd, FK_backup_storage &shares, FK_list *fk_add) { FK_list &fkeys= fk_add ? *fk_add : foreign_keys; if (fkeys.is_empty()) @@ -13043,7 +13043,7 @@ void Alter_table_ctx::fk_release_locks(THD* thd) /* Used in DROP TABLE: remove table from referenced_keys of referenced tables, prohibit if foreign_keys is not empty. */ static -bool fk_handle_drop(THD *thd, TABLE_LIST *table, FK_ddl_vector &shares, +bool fk_handle_drop(THD *thd, TABLE_LIST *table, FK_backup_storage &shares, bool drop_db) { DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, table->db.str, @@ -13175,7 +13175,7 @@ bool fk_handle_drop(THD *thd, TABLE_LIST *table, FK_ddl_vector &shares, */ bool fk_handle_rename(THD *thd, TABLE_LIST *old_table, const LEX_CSTRING *new_db, const LEX_CSTRING *new_table_name, - FK_ddl_vector &fk_rename_backup) + FK_backup_storage &fk_rename_backup) { DBUG_ASSERT(thd->mdl_context.is_lock_owner(MDL_key::TABLE, old_table->db.str, old_table->table_name.str, diff --git a/sql/sql_table.h b/sql/sql_table.h index 17faeeb1f5d..f73da4fc28d 100644 --- a/sql/sql_table.h +++ b/sql/sql_table.h @@ -26,7 +26,7 @@ class Alter_info; class Alter_table_ctx; class Column_definition; class Create_field; -class FK_ddl_vector; +class FK_backup_storage; struct TABLE_LIST; class THD; struct TABLE; @@ -218,7 +218,7 @@ bool execute_ddl_log_entry(THD *thd, uint first_entry); bool fk_handle_rename(THD *thd, TABLE_LIST *old_table, const LEX_CSTRING *new_db, const LEX_CSTRING *new_table_name, - FK_ddl_vector &fk_rename_backup); + FK_backup_storage &fk_rename_backup); template<typename T> class List; void promote_first_timestamp_column(List<Create_field> *column_definitions); diff --git a/sql/table.h b/sql/table.h index e52cb70126b..c689fb94128 100644 --- a/sql/table.h +++ b/sql/table.h @@ -52,7 +52,7 @@ struct TABLE_LIST; class ACL_internal_schema_access; class ACL_internal_table_access; class Field; -class FK_ddl_vector; +class FK_backup_storage; class Table_name; class Table_statistics; class With_element; @@ -732,7 +732,7 @@ struct TABLE_SHARE KEY *key_info; /* data of keys in database */ FK_list foreign_keys; FK_list referenced_keys; - bool fk_handle_create(THD *thd, FK_ddl_vector &shares, FK_list *fk_add= NULL); + bool fk_handle_create(THD *thd, FK_backup_storage &shares, FK_list *fk_add= NULL); bool fk_check_consistency(THD *thd); bool referenced_by_foreign_key() const { diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index e65c6b44a9e..bef0d906500 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -21510,7 +21510,7 @@ fk_upgrade_legacy_storage(dict_table_t* table, trx_t* trx, THD *thd, TABLE_SHARE // Got legacy foreign keys, update referenced shares FK_ddl_backup *share_backup; - FK_ddl_vector ref_shares; + FK_backup_storage ref_shares; if (share->fk_handle_create(thd, ref_shares, &d.foreign_keys)) { err = DB_ERROR; goto rollback; |