mirror of
https://github.com/MariaDB/server.git
synced 2025-12-10 19:44:09 +03:00
branches/zip: row_create_table_for_mysql(): Always roll back the transaction
when creating the table fails.
This commit is contained in:
@@ -1725,7 +1725,7 @@ row_create_table_for_mysql(
|
|||||||
" by the user.\n"
|
" by the user.\n"
|
||||||
"InnoDB: Shut down mysqld and edit my.cnf so that newraw"
|
"InnoDB: Shut down mysqld and edit my.cnf so that newraw"
|
||||||
" is replaced with raw.\n", stderr);
|
" is replaced with raw.\n", stderr);
|
||||||
|
err_exit:
|
||||||
dict_mem_table_free(table);
|
dict_mem_table_free(table);
|
||||||
trx_commit_for_mysql(trx);
|
trx_commit_for_mysql(trx);
|
||||||
|
|
||||||
@@ -1742,11 +1742,7 @@ row_create_table_for_mysql(
|
|||||||
"InnoDB: MySQL system tables must be"
|
"InnoDB: MySQL system tables must be"
|
||||||
" of the MyISAM type!\n",
|
" of the MyISAM type!\n",
|
||||||
table->name);
|
table->name);
|
||||||
|
goto err_exit;
|
||||||
dict_mem_table_free(table);
|
|
||||||
trx_commit_for_mysql(trx);
|
|
||||||
|
|
||||||
return(DB_ERROR);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check that no reserved column names are used. */
|
/* Check that no reserved column names are used. */
|
||||||
@@ -1754,10 +1750,7 @@ row_create_table_for_mysql(
|
|||||||
if (dict_col_name_is_reserved(
|
if (dict_col_name_is_reserved(
|
||||||
dict_table_get_col_name(table, i))) {
|
dict_table_get_col_name(table, i))) {
|
||||||
|
|
||||||
dict_mem_table_free(table);
|
goto err_exit;
|
||||||
trx_commit_for_mysql(trx);
|
|
||||||
|
|
||||||
return(DB_ERROR);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1833,10 +1826,13 @@ row_create_table_for_mysql(
|
|||||||
|
|
||||||
err = trx->error_state;
|
err = trx->error_state;
|
||||||
|
|
||||||
|
if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
|
||||||
|
trx->error_state = DB_SUCCESS;
|
||||||
|
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
switch (err) {
|
switch (err) {
|
||||||
case DB_OUT_OF_FILE_SPACE:
|
case DB_OUT_OF_FILE_SPACE:
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
|
||||||
|
|
||||||
ut_print_timestamp(stderr);
|
ut_print_timestamp(stderr);
|
||||||
fputs(" InnoDB: Warning: cannot create table ",
|
fputs(" InnoDB: Warning: cannot create table ",
|
||||||
stderr);
|
stderr);
|
||||||
@@ -1850,8 +1846,6 @@ row_create_table_for_mysql(
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DB_DUPLICATE_KEY:
|
case DB_DUPLICATE_KEY:
|
||||||
trx_general_rollback_for_mysql(trx, FALSE, NULL);
|
|
||||||
|
|
||||||
ut_print_timestamp(stderr);
|
ut_print_timestamp(stderr);
|
||||||
fputs(" InnoDB: Error: table ", stderr);
|
fputs(" InnoDB: Error: table ", stderr);
|
||||||
ut_print_name(stderr, trx, TRUE, table->name);
|
ut_print_name(stderr, trx, TRUE, table->name);
|
||||||
|
|||||||
Reference in New Issue
Block a user