diff options
author | unknown <monty@mysql.com> | 2004-10-06 01:24:21 +0300 |
---|---|---|
committer | unknown <monty@mysql.com> | 2004-10-06 01:24:21 +0300 |
commit | 12ea1d7540efd3d3ec86beb6f782b26936d9277e (patch) | |
tree | 0acac4cf9ee4cc804d6d4376b33bfb1b7f99efce /myisam/mi_close.c | |
parent | 2db923858253787cd5bb0082cfb14d13d3b5e906 (diff) | |
download | mariadb-git-12ea1d7540efd3d3ec86beb6f782b26936d9277e.tar.gz |
Reverted patch for new usage of open_count as it caused more problems than it solved
Cleaned up patch for checking locks for multi-table updates
myisam/mi_close.c:
Reverted patch for new usage of open_counts
myisam/mi_locking.c:
Reverted patch for new usage of open_counts
sql/ha_myisam.cc:
Reverted patch for new usage of open_counts
sql/handler.cc:
Removed compiler warning
sql/sql_acl.cc:
Removed compiler warning
sql/sql_table.cc:
No need to unlock after failed call to external_lock()
sql/sql_update.cc:
Cleaned up (and made it more secure) patch for checking locks for multi-table updates
Diffstat (limited to 'myisam/mi_close.c')
-rw-r--r-- | myisam/mi_close.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/myisam/mi_close.c b/myisam/mi_close.c index 47308a5e9eb..2712f0ca283 100644 --- a/myisam/mi_close.c +++ b/myisam/mi_close.c @@ -70,8 +70,13 @@ int mi_close(register MI_INFO *info) error=my_errno; if (share->kfile >= 0) { - /* We must always flush the state with the current open_count. */ - if (share->mode != O_RDONLY) + /* + If we are crashed, we can safely flush the current state as it will + not change the crashed state. + We can NOT write the state in other cases as other threads + may be using the file at this point + */ + if (share->mode != O_RDONLY && mi_is_crashed(info)) mi_state_info_write(share->kfile, &share->state, 1); if (my_close(share->kfile,MYF(0))) error = my_errno; |