Commit cdbd04dd authored by Marko Mäkelä's avatar Marko Mäkelä

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().
parent bee1bb05
...@@ -1378,9 +1378,6 @@ dict_create_or_check_foreign_constraint_tables(void) ...@@ -1378,9 +1378,6 @@ dict_create_or_check_foreign_constraint_tables(void)
ut_ad(!srv_any_background_activity()); 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_err = dict_check_if_system_table_exists(
"SYS_FOREIGN", DICT_NUM_FIELDS__SYS_FOREIGN + 1, 3); "SYS_FOREIGN", DICT_NUM_FIELDS__SYS_FOREIGN + 1, 3);
sys_foreign_cols_err = dict_check_if_system_table_exists( sys_foreign_cols_err = dict_check_if_system_table_exists(
...@@ -1419,16 +1416,6 @@ dict_create_or_check_foreign_constraint_tables(void) ...@@ -1419,16 +1416,6 @@ dict_create_or_check_foreign_constraint_tables(void)
row_drop_table_for_mysql("test/#sql-ib-garbage", trx, row_drop_table_for_mysql("test/#sql-ib-garbage", trx,
SQLCOM_DROP_DB, true);); 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."; ib::info() << "Creating foreign key constraint system tables.";
/* NOTE: in dict_load_foreigns we use the fact that /* NOTE: in dict_load_foreigns we use the fact that
...@@ -1471,14 +1458,11 @@ dict_create_or_check_foreign_constraint_tables(void) ...@@ -1471,14 +1458,11 @@ dict_create_or_check_foreign_constraint_tables(void)
if (UNIV_UNLIKELY(err != DB_SUCCESS)) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << "Creation of SYS_FOREIGN and SYS_FOREIGN_COLS" ib::error() << "Creation of SYS_FOREIGN and SYS_FOREIGN_COLS"
" failed: " << err << ". Tablespace is" " failed: " << err;
" full. Dropping incompletely created tables.";
ut_ad(err == DB_OUT_OF_FILE_SPACE ut_ad(err == DB_OUT_OF_FILE_SPACE
|| err == DB_TOO_MANY_CONCURRENT_TRXS); || err == DB_TOO_MANY_CONCURRENT_TRXS);
trx->rollback();
row_drop_table_after_create_fail("SYS_FOREIGN", trx);
row_drop_table_after_create_fail("SYS_FOREIGN_COLS", trx);
if (err == DB_OUT_OF_FILE_SPACE) { if (err == DB_OUT_OF_FILE_SPACE) {
err = DB_MUST_GET_MORE_FILE_SPACE; err = DB_MUST_GET_MORE_FILE_SPACE;
...@@ -1519,7 +1503,6 @@ dict_create_or_check_sys_virtual() ...@@ -1519,7 +1503,6 @@ dict_create_or_check_sys_virtual()
ut_ad(!srv_any_background_activity()); ut_ad(!srv_any_background_activity());
/* Note: The master thread has not been started at this point. */
err = dict_check_if_system_table_exists( err = dict_check_if_system_table_exists(
"SYS_VIRTUAL", DICT_NUM_FIELDS__SYS_VIRTUAL + 1, 1); "SYS_VIRTUAL", DICT_NUM_FIELDS__SYS_VIRTUAL + 1, 1);
...@@ -1543,12 +1526,6 @@ dict_create_or_check_sys_virtual() ...@@ -1543,12 +1526,6 @@ dict_create_or_check_sys_virtual()
row_mysql_lock_data_dictionary(trx); 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."; ib::info() << "Creating sys_virtual system tables.";
srv_file_per_table_backup = srv_file_per_table; srv_file_per_table_backup = srv_file_per_table;
...@@ -1571,15 +1548,11 @@ dict_create_or_check_sys_virtual() ...@@ -1571,15 +1548,11 @@ dict_create_or_check_sys_virtual()
FALSE, trx); FALSE, trx);
if (UNIV_UNLIKELY(err != DB_SUCCESS)) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
ib::error() << "Creation of SYS_VIRTUAL" ib::error() << "Creation of SYS_VIRTUAL failed: " << err;
" failed: " << err << ". Tablespace is"
" full or too many transactions."
" Dropping incompletely created tables.";
ut_ad(err == DB_OUT_OF_FILE_SPACE ut_ad(err == DB_OUT_OF_FILE_SPACE
|| err == DB_TOO_MANY_CONCURRENT_TRXS); || err == DB_TOO_MANY_CONCURRENT_TRXS);
trx->rollback();
row_drop_table_after_create_fail("SYS_VIRTUAL", trx);
if (err == DB_OUT_OF_FILE_SPACE) { if (err == DB_OUT_OF_FILE_SPACE) {
err = DB_MUST_GET_MORE_FILE_SPACE; err = DB_MUST_GET_MORE_FILE_SPACE;
......
...@@ -429,9 +429,6 @@ row_drop_table_for_mysql( ...@@ -429,9 +429,6 @@ row_drop_table_for_mysql(
bool create_failed = false, bool create_failed = false,
bool nonatomic = true); 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 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 means that this function deletes the .ibd file and assigns a new table id for
......
...@@ -3710,13 +3710,6 @@ row_drop_table_for_mysql( ...@@ -3710,13 +3710,6 @@ row_drop_table_for_mysql(
DBUG_RETURN(err); 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. Drop all foreign keys in a database, see Bug#18942.
Called at the end of row_drop_database_for_mysql(). Called at the end of row_drop_database_for_mysql().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment