diff options
author | unknown <tsmith@siva.hindu.god> | 2007-03-28 22:41:21 -0600 |
---|---|---|
committer | unknown <tsmith@siva.hindu.god> | 2007-03-28 22:41:21 -0600 |
commit | 3832b71b994714a45616cd8860a899a151d32697 (patch) | |
tree | df8721ad8c359f1d6321ed7cf38ba8e1f172772a /innobase | |
parent | 465cf7380aad2f370d97ec38a1c72d6acb174b16 (diff) | |
download | mariadb-git-3832b71b994714a45616cd8860a899a151d32697.tar.gz |
Apply innodb-5.0-ss1372 snapshot
Bug #27381: InnoDB exits when attempting to rename table to non-existant database
Fix Bug#27381 by calling os_file_handle_error_no_exit() instead of
os_file_handle_error().
innobase/dict/dict0dict.c:
Apply innodb-5.0-ss1372 snapshot
Revision r1351:
branches/5.0: Merge r1350 from trunk:
Lock the data dictionary during rollback. This removes the rare
debug assertion failure ut_ad(mutex_own(&(dict_sys->mutex))) in
dict_table_get_on_id() after the rollback following crash recovery.
innobase/os/os0file.c:
Apply innodb-5.0-ss1372 snapshot
Revision r1354:
branches/5.0: Merge r1352 from trunk:
(also make indentation the same as in 5.1 to ease further merges)
Fix typo in comment in os/os0file.c
Revision r1370:
branches/5.0: Merge r1366 from trunk:
Fix Bug#27381 by calling os_file_handle_error_no_exit() instead of
os_file_handle_error().
innobase/row/row0undo.c:
Apply innodb-5.0-ss1372 snapshot
Revision r1351:
branches/5.0: Merge r1350 from trunk:
Lock the data dictionary during rollback. This removes the rare
debug assertion failure ut_ad(mutex_own(&(dict_sys->mutex))) in
dict_table_get_on_id() after the rollback following crash recovery.
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/dict/dict0dict.c | 3 | ||||
-rw-r--r-- | innobase/os/os0file.c | 20 | ||||
-rw-r--r-- | innobase/row/row0undo.c | 20 |
3 files changed, 22 insertions, 21 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c index 33aebb25071..96c822857df 100644 --- a/innobase/dict/dict0dict.c +++ b/innobase/dict/dict0dict.c @@ -628,7 +628,8 @@ dict_table_get_on_id( CREATE, for example, we already have the mutex! */ #ifdef UNIV_SYNC_DEBUG - ut_ad(mutex_own(&(dict_sys->mutex))); + ut_ad(mutex_own(&(dict_sys->mutex)) + || trx->dict_operation_lock_mode == RW_X_LATCH); #endif /* UNIV_SYNC_DEBUG */ return(dict_table_get_on_id_low(table_id, trx)); diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 5e5c4b19eb0..72f1f837fee 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -920,14 +920,14 @@ try_again: } file = CreateFile((LPCTSTR) name, - access, - FILE_SHARE_READ | FILE_SHARE_WRITE, - /* file can be read ansd written also - by other processes */ - NULL, /* default security attributes */ - create_flag, - attributes, - NULL); /* no template file */ + access, + FILE_SHARE_READ | FILE_SHARE_WRITE, + /* file can be read and written also + by other processes */ + NULL, /* default security attributes */ + create_flag, + attributes, + NULL); /* no template file */ if (file == INVALID_HANDLE_VALUE) { *success = FALSE; @@ -1494,7 +1494,7 @@ os_file_rename( return(TRUE); } - os_file_handle_error(oldpath, "rename"); + os_file_handle_error_no_exit(oldpath, "rename"); return(FALSE); #else @@ -1503,7 +1503,7 @@ os_file_rename( ret = rename((const char*)oldpath, (const char*)newpath); if (ret != 0) { - os_file_handle_error(oldpath, "rename"); + os_file_handle_error_no_exit(oldpath, "rename"); return(FALSE); } diff --git a/innobase/row/row0undo.c b/innobase/row/row0undo.c index 435c0279dbb..c9727e0098e 100644 --- a/innobase/row/row0undo.c +++ b/innobase/row/row0undo.c @@ -212,7 +212,7 @@ row_undo( ulint err; trx_t* trx; dulint roll_ptr; - ibool froze_data_dict = FALSE; + ibool locked_data_dict; ut_ad(node && thr); @@ -263,15 +263,15 @@ row_undo( } /* Prevent DROP TABLE etc. while we are rolling back this row. - If we are doing a TABLE CREATE or some other dictionary operation, - then we already have dict_operation_lock locked in x-mode. Do not - try to lock again in s-mode, because that would cause a hang. */ + If we are doing a TABLE CREATE or some other dictionary operation, + then we already have dict_operation_lock locked in x-mode. Do not + try to lock again, because that would cause a hang. */ - if (trx->dict_operation_lock_mode == 0) { - - row_mysql_freeze_data_dictionary(trx); + locked_data_dict = (trx->dict_operation_lock_mode == 0); - froze_data_dict = TRUE; + if (locked_data_dict) { + + row_mysql_lock_data_dictionary(trx); } if (node->state == UNDO_NODE_INSERT) { @@ -284,9 +284,9 @@ row_undo( err = row_undo_mod(node, thr); } - if (froze_data_dict) { + if (locked_data_dict) { - row_mysql_unfreeze_data_dictionary(trx); + row_mysql_unlock_data_dictionary(trx); } /* Do some cleanup */ |