mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
MDEV-18518 fixup: Remove row_drop_table_after_create_fail()
row_drop_table_after_create_fail(): Remove. This function was only used during InnoDB initialization (or upgrade) when creating a system table failed. Rollback will clean up a failed CREATE just fine, by invoking dict_drop_index_tree().
This commit is contained in:
parent
bee1bb056d
commit
cdbd04dde5
3 changed files with 4 additions and 41 deletions
|
@ -1378,9 +1378,6 @@ dict_create_or_check_foreign_constraint_tables(void)
|
|||
|
||||
ut_ad(!srv_any_background_activity());
|
||||
|
||||
/* Note: The master thread has not been started at this point. */
|
||||
|
||||
|
||||
sys_foreign_err = dict_check_if_system_table_exists(
|
||||
"SYS_FOREIGN", DICT_NUM_FIELDS__SYS_FOREIGN + 1, 3);
|
||||
sys_foreign_cols_err = dict_check_if_system_table_exists(
|
||||
|
@ -1419,16 +1416,6 @@ dict_create_or_check_foreign_constraint_tables(void)
|
|||
row_drop_table_for_mysql("test/#sql-ib-garbage", trx,
|
||||
SQLCOM_DROP_DB, true););
|
||||
|
||||
/* Check which incomplete table definition to drop. */
|
||||
|
||||
if (sys_foreign_err == DB_CORRUPTION) {
|
||||
row_drop_table_after_create_fail("SYS_FOREIGN", trx);
|
||||
}
|
||||
|
||||
if (sys_foreign_cols_err == DB_CORRUPTION) {
|
||||
row_drop_table_after_create_fail("SYS_FOREIGN_COLS", trx);
|
||||
}
|
||||
|
||||
ib::info() << "Creating foreign key constraint system tables.";
|
||||
|
||||
/* NOTE: in dict_load_foreigns we use the fact that
|
||||
|
@ -1471,14 +1458,11 @@ dict_create_or_check_foreign_constraint_tables(void)
|
|||
|
||||
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
|
||||
ib::error() << "Creation of SYS_FOREIGN and SYS_FOREIGN_COLS"
|
||||
" failed: " << err << ". Tablespace is"
|
||||
" full. Dropping incompletely created tables.";
|
||||
" failed: " << err;
|
||||
|
||||
ut_ad(err == DB_OUT_OF_FILE_SPACE
|
||||
|| err == DB_TOO_MANY_CONCURRENT_TRXS);
|
||||
|
||||
row_drop_table_after_create_fail("SYS_FOREIGN", trx);
|
||||
row_drop_table_after_create_fail("SYS_FOREIGN_COLS", trx);
|
||||
trx->rollback();
|
||||
|
||||
if (err == DB_OUT_OF_FILE_SPACE) {
|
||||
err = DB_MUST_GET_MORE_FILE_SPACE;
|
||||
|
@ -1519,7 +1503,6 @@ dict_create_or_check_sys_virtual()
|
|||
|
||||
ut_ad(!srv_any_background_activity());
|
||||
|
||||
/* Note: The master thread has not been started at this point. */
|
||||
err = dict_check_if_system_table_exists(
|
||||
"SYS_VIRTUAL", DICT_NUM_FIELDS__SYS_VIRTUAL + 1, 1);
|
||||
|
||||
|
@ -1543,12 +1526,6 @@ dict_create_or_check_sys_virtual()
|
|||
|
||||
row_mysql_lock_data_dictionary(trx);
|
||||
|
||||
/* Check which incomplete table definition to drop. */
|
||||
|
||||
if (err == DB_CORRUPTION) {
|
||||
row_drop_table_after_create_fail("SYS_VIRTUAL", trx);
|
||||
}
|
||||
|
||||
ib::info() << "Creating sys_virtual system tables.";
|
||||
|
||||
srv_file_per_table_backup = srv_file_per_table;
|
||||
|
@ -1571,15 +1548,11 @@ dict_create_or_check_sys_virtual()
|
|||
FALSE, trx);
|
||||
|
||||
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
|
||||
ib::error() << "Creation of SYS_VIRTUAL"
|
||||
" failed: " << err << ". Tablespace is"
|
||||
" full or too many transactions."
|
||||
" Dropping incompletely created tables.";
|
||||
ib::error() << "Creation of SYS_VIRTUAL failed: " << err;
|
||||
|
||||
ut_ad(err == DB_OUT_OF_FILE_SPACE
|
||||
|| err == DB_TOO_MANY_CONCURRENT_TRXS);
|
||||
|
||||
row_drop_table_after_create_fail("SYS_VIRTUAL", trx);
|
||||
trx->rollback();
|
||||
|
||||
if (err == DB_OUT_OF_FILE_SPACE) {
|
||||
err = DB_MUST_GET_MORE_FILE_SPACE;
|
||||
|
|
|
@ -429,9 +429,6 @@ row_drop_table_for_mysql(
|
|||
bool create_failed = false,
|
||||
bool nonatomic = true);
|
||||
|
||||
/** Drop a table after failed CREATE TABLE. */
|
||||
dberr_t row_drop_table_after_create_fail(const char* name, trx_t* trx);
|
||||
|
||||
/*********************************************************************//**
|
||||
Discards the tablespace of a table which stored in an .ibd file. Discarding
|
||||
means that this function deletes the .ibd file and assigns a new table id for
|
||||
|
|
|
@ -3710,13 +3710,6 @@ funct_exit_all_freed:
|
|||
DBUG_RETURN(err);
|
||||
}
|
||||
|
||||
/** Drop a table after failed CREATE TABLE. */
|
||||
dberr_t row_drop_table_after_create_fail(const char* name, trx_t* trx)
|
||||
{
|
||||
ib::warn() << "Dropping incompletely created " << name << " table.";
|
||||
return row_drop_table_for_mysql(name, trx, SQLCOM_DROP_DB, true);
|
||||
}
|
||||
|
||||
/*******************************************************************//**
|
||||
Drop all foreign keys in a database, see Bug#18942.
|
||||
Called at the end of row_drop_database_for_mysql().
|
||||
|
|
Loading…
Add table
Reference in a new issue