summaryrefslogtreecommitdiff
path: root/mysql-test/t/windows.test
diff options
context:
space:
mode:
authorKristofer.Pettersson@naruto. <>2006-09-12 14:23:41 +0200
committerKristofer.Pettersson@naruto. <>2006-09-12 14:23:41 +0200
commit323efcc0c185e69b1dc35fa6f637aae5905d8080 (patch)
tree54570506dd929d5af3c16a801d223dd71430e3ab /mysql-test/t/windows.test
parent39a8fe6e4490f77a731c33f80cfd2e307d9bb028 (diff)
downloadmariadb-git-323efcc0c185e69b1dc35fa6f637aae5905d8080.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.
Diffstat (limited to 'mysql-test/t/windows.test')
-rw-r--r--mysql-test/t/windows.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/mysql-test/t/windows.test b/mysql-test/t/windows.test
index d6bcfeb8cb3..79517df6517 100644
--- a/mysql-test/t/windows.test
+++ b/mysql-test/t/windows.test
@@ -18,3 +18,42 @@ create table nu (a int);
drop table nu;
# End of 4.1 tests
+
+#
+# Bug #20789: Merge Subtable Rename Causes Crash
+#
+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 the merge table and thus open it.
+INSERT INTO mt VALUES ('2006-01-01',0);
+
+# Alter one of the tables that are part of the merge table
+ALTER TABLE `t2` RENAME TO `t`;
+
+# Insert into the merge table that has just been altered
+--error 1015
+INSERT INTO mt VALUES ('2006-01-01',0);
+--error 1015
+select * from mt;
+
+FLUSH TABLES;
+--error 1017
+select * from mt;
+
+# Alter one of the tables that are part of the merge table
+ALTER TABLE `t` RENAME TO `t2`;
+INSERT INTO mt VALUES ('2006-01-01',0);
+select * from mt;
+