summaryrefslogtreecommitdiff
path: root/myisam/mi_close.c
diff options
context:
space:
mode:
authoringo@mysql.com <>2004-09-18 20:33:39 +0200
committeringo@mysql.com <>2004-09-18 20:33:39 +0200
commit7afb03b7edb9037212b5da39db4350c4eeeca72c (patch)
treef3658d5151d0eec668e2a6a6702b3ad26c908d15 /myisam/mi_close.c
parentcda336b9289be4368998986eaed2c7439e59a82e (diff)
downloadmariadb-git-7afb03b7edb9037212b5da39db4350c4eeeca72c.tar.gz
bug#2831 - --extenral-locking does not fully work with --myisam-recover.
Changed the semantics of open_count so that it is decremented at every unlock (if it was incremented due to data changes). So it indicates a crash, if it is non-zero after a lock. The table will then be repaired.
Diffstat (limited to 'myisam/mi_close.c')
-rw-r--r--myisam/mi_close.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/myisam/mi_close.c b/myisam/mi_close.c
index dbaaebb1143..47308a5e9eb 100644
--- a/myisam/mi_close.c
+++ b/myisam/mi_close.c
@@ -70,7 +70,8 @@ int mi_close(register MI_INFO *info)
error=my_errno;
if (share->kfile >= 0)
{
- if (share->mode != O_RDONLY && mi_is_crashed(info))
+ /* We must always flush the state with the current open_count. */
+ if (share->mode != O_RDONLY)
mi_state_info_write(share->kfile, &share->state, 1);
if (my_close(share->kfile,MYF(0)))
error = my_errno;