Commit bf1f73aa authored by marko's avatar marko

branches/zip: row_create_table_for_mysql(): Always roll back the transaction

when creating the table fails.
parent 1d4ada1a
...@@ -1725,7 +1725,7 @@ row_create_table_for_mysql( ...@@ -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( ...@@ -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( ...@@ -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( ...@@ -1833,10 +1826,13 @@ row_create_table_for_mysql(
err = trx->error_state; err = trx->error_state;
switch (err) { if (UNIV_UNLIKELY(err != DB_SUCCESS)) {
case DB_OUT_OF_FILE_SPACE: trx->error_state = DB_SUCCESS;
trx_general_rollback_for_mysql(trx, FALSE, NULL); trx_general_rollback_for_mysql(trx, FALSE, NULL);
}
switch (err) {
case DB_OUT_OF_FILE_SPACE:
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( ...@@ -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);
......
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