summaryrefslogtreecommitdiff
path: root/mysql-test/r/windows.result
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 /mysql-test/r/windows.result
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 'mysql-test/r/windows.result')
-rw-r--r--mysql-test/r/windows.result28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/r/windows.result b/mysql-test/r/windows.result
index 039c5b1476e..e3241daf719 100644
--- a/mysql-test/r/windows.result
+++ b/mysql-test/r/windows.result
@@ -6,3 +6,31 @@ use prn;
ERROR 42000: Unknown database 'prn'
create table nu (a int);
drop table nu;
+CREATE TABLE `t1` (
+`TIM` datetime NOT NULL,
+`VAL` double default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE TABLE `t2` (
+`TIM` datetime NOT NULL,
+`VAL` double default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+CREATE TABLE `mt` (
+`TIM` datetime NOT NULL,
+`VAL` double default NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST
+UNION=(`t1`,`t2`);
+INSERT INTO mt VALUES ('2006-01-01',0);
+ALTER TABLE `t2` RENAME TO `t`;
+INSERT INTO mt VALUES ('2006-01-01',0);
+ERROR HY000: Can't lock file (errno: 155)
+select * from mt;
+ERROR HY000: Can't lock file (errno: 155)
+FLUSH TABLES;
+select * from mt;
+ERROR HY000: Can't find file: 'mt' (errno: 2)
+ALTER TABLE `t` RENAME TO `t2`;
+INSERT INTO mt VALUES ('2006-01-01',0);
+select * from mt;
+TIM VAL
+2006-01-01 00:00:00 0
+2006-01-01 00:00:00 0