From d9db67696e3b08e002b11e3a5730c2ee1ae5a9fb Mon Sep 17 00:00:00 2001 From: marko <Unknown> Date: Mon, 13 Aug 2007 12:46:13 +0000 Subject: [PATCH] branches/zip: row_rename_table_for_mysql(): Change the return type to ulint and simplify error handling. --- include/row0mysql.h | 2 +- row/row0mysql.c | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/row0mysql.h b/include/row0mysql.h index 7119707835c..2097358fbf5 100644 --- a/include/row0mysql.h +++ b/include/row0mysql.h @@ -488,7 +488,7 @@ row_drop_database_for_mysql( /************************************************************************* Renames a table for MySQL. */ -int +ulint row_rename_table_for_mysql( /*=======================*/ /* out: error code or DB_SUCCESS */ diff --git a/row/row0mysql.c b/row/row0mysql.c index 6bfb207483f..82aac4d9845 100644 --- a/row/row0mysql.c +++ b/row/row0mysql.c @@ -3747,7 +3747,7 @@ row_delete_constraint( /************************************************************************* Renames a table for MySQL. */ -int +ulint row_rename_table_for_mysql( /*=======================*/ /* out: error code or DB_SUCCESS */ @@ -3757,7 +3757,7 @@ row_rename_table_for_mysql( ibool commit) /* in: if TRUE then commit trx */ { dict_table_t* table; - ulint err; + ulint err = DB_ERROR; mem_heap_t* heap = NULL; const char** constraints_to_drop = NULL; ulint n_constraints_to_drop = 0; @@ -3777,8 +3777,7 @@ row_rename_table_for_mysql( "InnoDB: with raw, and innodb_force_... is removed.\n", stderr); - trx_commit_for_mysql(trx); - return(DB_ERROR); + goto funct_exit; } else if (row_mysql_is_system_table(new_name)) { fprintf(stderr, @@ -3788,8 +3787,7 @@ row_rename_table_for_mysql( " of the MyISAM type!\n", new_name); - trx_commit_for_mysql(trx); - return(DB_ERROR); + goto funct_exit; } trx->op_info = "renaming table"; @@ -4080,7 +4078,7 @@ row_rename_table_for_mysql( trx->op_info = ""; - return((int) err); + return(err); } /************************************************************************* -- 2.30.9