Commit d9db6769 authored by marko's avatar marko

branches/zip: row_rename_table_for_mysql(): Change the return type to ulint

and simplify error handling.
parent 845bd091
...@@ -488,7 +488,7 @@ row_drop_database_for_mysql( ...@@ -488,7 +488,7 @@ row_drop_database_for_mysql(
/************************************************************************* /*************************************************************************
Renames a table for MySQL. */ Renames a table for MySQL. */
int ulint
row_rename_table_for_mysql( row_rename_table_for_mysql(
/*=======================*/ /*=======================*/
/* out: error code or DB_SUCCESS */ /* out: error code or DB_SUCCESS */
......
...@@ -3747,7 +3747,7 @@ row_delete_constraint( ...@@ -3747,7 +3747,7 @@ row_delete_constraint(
/************************************************************************* /*************************************************************************
Renames a table for MySQL. */ Renames a table for MySQL. */
int ulint
row_rename_table_for_mysql( row_rename_table_for_mysql(
/*=======================*/ /*=======================*/
/* out: error code or DB_SUCCESS */ /* out: error code or DB_SUCCESS */
...@@ -3757,7 +3757,7 @@ row_rename_table_for_mysql( ...@@ -3757,7 +3757,7 @@ row_rename_table_for_mysql(
ibool commit) /* in: if TRUE then commit trx */ ibool commit) /* in: if TRUE then commit trx */
{ {
dict_table_t* table; dict_table_t* table;
ulint err; ulint err = DB_ERROR;
mem_heap_t* heap = NULL; mem_heap_t* heap = NULL;
const char** constraints_to_drop = NULL; const char** constraints_to_drop = NULL;
ulint n_constraints_to_drop = 0; ulint n_constraints_to_drop = 0;
...@@ -3777,8 +3777,7 @@ row_rename_table_for_mysql( ...@@ -3777,8 +3777,7 @@ row_rename_table_for_mysql(
"InnoDB: with raw, and innodb_force_... is removed.\n", "InnoDB: with raw, and innodb_force_... is removed.\n",
stderr); stderr);
trx_commit_for_mysql(trx); goto funct_exit;
return(DB_ERROR);
} else if (row_mysql_is_system_table(new_name)) { } else if (row_mysql_is_system_table(new_name)) {
fprintf(stderr, fprintf(stderr,
...@@ -3788,8 +3787,7 @@ row_rename_table_for_mysql( ...@@ -3788,8 +3787,7 @@ row_rename_table_for_mysql(
" of the MyISAM type!\n", " of the MyISAM type!\n",
new_name); new_name);
trx_commit_for_mysql(trx); goto funct_exit;
return(DB_ERROR);
} }
trx->op_info = "renaming table"; trx->op_info = "renaming table";
...@@ -4080,7 +4078,7 @@ funct_exit: ...@@ -4080,7 +4078,7 @@ funct_exit:
trx->op_info = ""; trx->op_info = "";
return((int) err); return(err);
} }
/************************************************************************* /*************************************************************************
......
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