From 21f23fb76ff152ea4f22e60abb64dcbb489e8885 Mon Sep 17 00:00:00 2001 From: "aivanov@mysql.com" <> Date: Tue, 6 Jun 2006 23:05:10 +0400 Subject: [PATCH 1/3] Applied innodb-4.1-ss31 snapshot. Fixed BUG#19727 "InnoDB crashed server and crashed tables are not recoverable". --- innobase/row/row0mysql.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 23d019b6f78..1ee920ffb14 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2237,14 +2237,14 @@ do not allow the discard. We also reserve the data dictionary latch. */ } } funct_exit: + trx_commit_for_mysql(trx); + row_mysql_unlock_data_dictionary(trx); if (graph) { que_graph_free(graph); } - trx_commit_for_mysql(trx); - trx->op_info = ""; return((int) err); @@ -2374,10 +2374,10 @@ row_import_tablespace_for_mysql( } funct_exit: - row_mysql_unlock_data_dictionary(trx); - trx_commit_for_mysql(trx); + row_mysql_unlock_data_dictionary(trx); + trx->op_info = ""; return((int) err); @@ -2769,6 +2769,8 @@ fputs(" InnoDB: You are trying to drop table ", stderr); } funct_exit: + trx_commit_for_mysql(trx); + if (locked_dictionary) { row_mysql_unlock_data_dictionary(trx); } @@ -2779,8 +2781,6 @@ funct_exit: que_graph_free(graph); - trx_commit_for_mysql(trx); - trx->op_info = ""; srv_wake_master_thread(); @@ -2857,10 +2857,10 @@ loop: } } - row_mysql_unlock_data_dictionary(trx); - trx_commit_for_mysql(trx); + row_mysql_unlock_data_dictionary(trx); + trx->op_info = ""; return(err); @@ -3272,6 +3272,8 @@ row_rename_table_for_mysql( } } funct_exit: + trx_commit_for_mysql(trx); + if (!recovering_temp_table) { row_mysql_unlock_data_dictionary(trx); } @@ -3284,8 +3286,6 @@ funct_exit: mem_heap_free(heap); } - trx_commit_for_mysql(trx); - trx->op_info = ""; return((int) err); From c46b17a7310da72ff2f36702831c0b261ef44f2a Mon Sep 17 00:00:00 2001 From: "aivanov@mysql.com" <> Date: Tue, 6 Jun 2006 23:37:42 +0400 Subject: [PATCH 2/3] Applied innodb-5.0-ss609 snapshot. Fixed BUG#19727 "InnoDB crashed server and crashed tables are not recoverable". --- innobase/row/row0mysql.c | 20 ++++++++++---------- innobase/row/row0sel.c | 3 ++- mysql-test/t/innodb.test | 13 +++++++++++++ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 89b82882d93..9e922a3e04a 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2570,14 +2570,14 @@ do not allow the discard. We also reserve the data dictionary latch. */ } } funct_exit: + trx_commit_for_mysql(trx); + row_mysql_unlock_data_dictionary(trx); if (graph) { que_graph_free(graph); } - trx_commit_for_mysql(trx); - trx->op_info = ""; return((int) err); @@ -2707,10 +2707,10 @@ row_import_tablespace_for_mysql( } funct_exit: - row_mysql_unlock_data_dictionary(trx); - trx_commit_for_mysql(trx); + row_mysql_unlock_data_dictionary(trx); + trx->op_info = ""; return((int) err); @@ -3398,6 +3398,8 @@ fputs(" InnoDB: You are trying to drop table ", stderr); } funct_exit: + trx_commit_for_mysql(trx); + if (locked_dictionary) { row_mysql_unlock_data_dictionary(trx); } @@ -3408,8 +3410,6 @@ funct_exit: que_graph_free(graph); - trx_commit_for_mysql(trx); - trx->op_info = ""; #ifndef UNIV_HOTBACKUP @@ -3488,10 +3488,10 @@ loop: } } - row_mysql_unlock_data_dictionary(trx); - trx_commit_for_mysql(trx); + row_mysql_unlock_data_dictionary(trx); + trx->op_info = ""; return(err); @@ -3905,6 +3905,8 @@ row_rename_table_for_mysql( } } funct_exit: + trx_commit_for_mysql(trx); + if (!recovering_temp_table) { row_mysql_unlock_data_dictionary(trx); } @@ -3917,8 +3919,6 @@ funct_exit: mem_heap_free(heap); } - trx_commit_for_mysql(trx); - trx->op_info = ""; return((int) err); diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 1402d3aaba6..23971767e7e 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -1064,11 +1064,12 @@ row_sel_try_search_shortcut( ut_ad(plan->pcur.latch_mode == node->latch_mode); plan->n_rows_fetched++; + ret = SEL_FOUND; func_exit: if (UNIV_LIKELY_NULL(heap)) { mem_heap_free(heap); } - return(SEL_FOUND); + return(ret); } /************************************************************************* diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index e4c8bf89cca..71b178d0e57 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -2196,3 +2196,16 @@ drop table t2, t1; # --error ER_TABLE_CANT_HANDLE_SPKEYS create table t1 (g geometry not null, spatial gk(g)) engine=innodb; + +####################################################################### +# # +# Please, DO NOT TOUCH this file as well as the innodb.result file. # +# These files are to be modified ONLY BY INNOBASE guys. # +# # +# Use innodb_mysql.[test|result] files instead. # +# # +# If nevertheless you need to make some changes here, please, forward # +# your commit message To: dev@innodb.com Cc: dev-innodb@mysql.com # +# (otherwise your changes may be erased). # +# # +####################################################################### From 53c9173e1bef5b6c6b0457356cec65f1850d7696 Mon Sep 17 00:00:00 2001 From: "aivanov@mysql.com" <> Date: Mon, 12 Jun 2006 13:52:29 +0400 Subject: [PATCH 3/3] Making dtype_get_max_size() non-inline to avoid build error in non-debug mode. --- storage/innobase/data/data0type.c | 1 - storage/innobase/include/data0type.h | 1 - 2 files changed, 2 deletions(-) diff --git a/storage/innobase/data/data0type.c b/storage/innobase/data/data0type.c index feac6739101..54dbb7b1a15 100644 --- a/storage/innobase/data/data0type.c +++ b/storage/innobase/data/data0type.c @@ -297,7 +297,6 @@ dtype_print( /*************************************************************************** Returns the maximum size of a data type. Note: types in system tables may be incomplete and return incorrect information. */ -UNIV_INLINE ulint dtype_get_max_size( /*===============*/ diff --git a/storage/innobase/include/data0type.h b/storage/innobase/include/data0type.h index 1c998c8dc56..789b76b1498 100644 --- a/storage/innobase/include/data0type.h +++ b/storage/innobase/include/data0type.h @@ -332,7 +332,6 @@ dtype_get_min_size( /*************************************************************************** Returns the maximum size of a data type. Note: types in system tables may be incomplete and return incorrect information. */ -UNIV_INLINE ulint dtype_get_max_size( /*===============*/