mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
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().
This commit is contained in:
parent
979102de3b
commit
83694ca440
3 changed files with 22 additions and 21 deletions
|
@ -628,7 +628,8 @@ dict_table_get_on_id(
|
||||||
CREATE, for example, we already have the mutex! */
|
CREATE, for example, we already have the mutex! */
|
||||||
|
|
||||||
#ifdef UNIV_SYNC_DEBUG
|
#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 */
|
#endif /* UNIV_SYNC_DEBUG */
|
||||||
|
|
||||||
return(dict_table_get_on_id_low(table_id, trx));
|
return(dict_table_get_on_id_low(table_id, trx));
|
||||||
|
|
|
@ -922,7 +922,7 @@ try_again:
|
||||||
file = CreateFile((LPCTSTR) name,
|
file = CreateFile((LPCTSTR) name,
|
||||||
access,
|
access,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
/* file can be read ansd written also
|
/* file can be read and written also
|
||||||
by other processes */
|
by other processes */
|
||||||
NULL, /* default security attributes */
|
NULL, /* default security attributes */
|
||||||
create_flag,
|
create_flag,
|
||||||
|
@ -1494,7 +1494,7 @@ os_file_rename(
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
os_file_handle_error(oldpath, "rename");
|
os_file_handle_error_no_exit(oldpath, "rename");
|
||||||
|
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
#else
|
#else
|
||||||
|
@ -1503,7 +1503,7 @@ os_file_rename(
|
||||||
ret = rename((const char*)oldpath, (const char*)newpath);
|
ret = rename((const char*)oldpath, (const char*)newpath);
|
||||||
|
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
os_file_handle_error(oldpath, "rename");
|
os_file_handle_error_no_exit(oldpath, "rename");
|
||||||
|
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -212,7 +212,7 @@ row_undo(
|
||||||
ulint err;
|
ulint err;
|
||||||
trx_t* trx;
|
trx_t* trx;
|
||||||
dulint roll_ptr;
|
dulint roll_ptr;
|
||||||
ibool froze_data_dict = FALSE;
|
ibool locked_data_dict;
|
||||||
|
|
||||||
ut_ad(node && thr);
|
ut_ad(node && thr);
|
||||||
|
|
||||||
|
@ -265,13 +265,13 @@ row_undo(
|
||||||
/* Prevent DROP TABLE etc. while we are rolling back this row.
|
/* Prevent DROP TABLE etc. while we are rolling back this row.
|
||||||
If we are doing a TABLE CREATE or some other dictionary operation,
|
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
|
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. */
|
try to lock again, because that would cause a hang. */
|
||||||
|
|
||||||
if (trx->dict_operation_lock_mode == 0) {
|
locked_data_dict = (trx->dict_operation_lock_mode == 0);
|
||||||
|
|
||||||
row_mysql_freeze_data_dictionary(trx);
|
if (locked_data_dict) {
|
||||||
|
|
||||||
froze_data_dict = TRUE;
|
row_mysql_lock_data_dictionary(trx);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node->state == UNDO_NODE_INSERT) {
|
if (node->state == UNDO_NODE_INSERT) {
|
||||||
|
@ -284,9 +284,9 @@ row_undo(
|
||||||
err = row_undo_mod(node, thr);
|
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 */
|
/* Do some cleanup */
|
||||||
|
|
Loading…
Reference in a new issue