summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <Kristofer.Pettersson@naruto.>2006-09-12 14:23:41 +0200
committerunknown <Kristofer.Pettersson@naruto.>2006-09-12 14:23:41 +0200
commit3ca9164590151e932ef4750b78e0b927788a3a9a (patch)
tree54570506dd929d5af3c16a801d223dd71430e3ab /myisam
parentad0f34e38e22d215328ee2407bf232ee5caf6609 (diff)
downloadmariadb-git-3ca9164590151e932ef4750b78e0b927788a3a9a.tar.gz
Bug#20789 Merge Subtable Rename Causes Crash
- When an ALTER TABLE RENAME is performed on windows, the files are closed and their cached file descriptors are marked invalid. Performing INSERT, UPDATE or SELECT on the associated merge table causes a server crash on windows. This patch adds a test for bad file descriptors when a table attempts a lock. If a bad descriptor is found an error is thrown. An additional FLUSH TABLES will be necessary to further operate on the associated merge table. myisam/mi_locking.c: This patch prevents the windows built to crash if the file is closed. mysql-test/r/windows.result: Added test case for the windows built. mysql-test/t/windows.test: Added test case for the windows built.
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_locking.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index 8d48c5242e5..4f8420d4b12 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -223,7 +223,18 @@ int mi_lock_database(MI_INFO *info, int lock_type)
default:
break; /* Impossible */
}
+ }
+#ifdef __WIN__
+ else
+ {
+ /*
+ The file has been closed and kfile is -1.
+ See mi_extra.c about implementation of
+ HA_EXTRA_PREPARE_FOR_DELETE.
+ */
+ error=HA_ERR_NO_SUCH_TABLE;
}
+#endif
pthread_mutex_unlock(&share->intern_lock);
#if defined(FULL_LOG) || defined(_lint)
lock_type|=(int) (flag << 8); /* Set bit to set if real lock */