#At file:///opt/local/work/next-4284/ based on revid:kostja@stripped
3010 Konstantin Osipov 2009-12-09
----------------------------------------------------------
revno: 2617.69.33
committer: Konstantin Osipov <kostja@stripped>
branch nick: mysql-next-46452
timestamp: Wed 2009-08-19 18:39:31 +0400
message:
Bug#46452 "Crash in MDL, HANDLER OPEN + TRUNCATE TABLE".
Flush open HANDLER tables before TRUNCATE, which is a DDL.
@ mysql-test/r/truncate.result
Update results for Bug#46452.
@ mysql-test/t/truncate.test
Add a test case for Bug#46452 "Crash in MDL, HANDLER OPEN + TRUNCATE TABLE".
modified:
mysql-test/r/truncate.result
mysql-test/t/truncate.test
=== modified file 'mysql-test/r/truncate.result'
--- a/mysql-test/r/truncate.result 2007-04-17 10:32:01 +0000
+++ b/mysql-test/r/truncate.result 2009-12-09 09:29:36 +0000
@@ -60,3 +60,17 @@ truncate table v1;
ERROR 42S02: Table 'test.v1' doesn't exist
drop view v1;
drop table t1;
+#
+# Bug#46452 Crash in MDL, HANDLER OPEN + TRUNCATE TABLE
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 AS SELECT 1 AS f1;
+HANDLER t1 OPEN;
+# Here comes the crash.
+TRUNCATE t1;
+# Currently TRUNCATE, just like other DDL, implicitly closes
+# open HANDLER table.
+HANDLER t1 READ FIRST;
+ERROR 42S02: Unknown table 't1' in HANDLER
+DROP TABLE t1;
+# End of 6.0 tests
=== modified file 'mysql-test/t/truncate.test'
--- a/mysql-test/t/truncate.test 2007-04-17 10:32:01 +0000
+++ b/mysql-test/t/truncate.test 2009-12-09 09:29:36 +0000
@@ -69,3 +69,26 @@ drop table t1;
# End of 5.0 tests
+--echo #
+--echo # Bug#46452 Crash in MDL, HANDLER OPEN + TRUNCATE TABLE
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 AS SELECT 1 AS f1;
+
+HANDLER t1 OPEN;
+--echo # Here comes the crash.
+TRUNCATE t1;
+
+--echo # Currently TRUNCATE, just like other DDL, implicitly closes
+--echo # open HANDLER table.
+--error ER_UNKNOWN_TABLE
+HANDLER t1 READ FIRST;
+
+# Cleanup
+DROP TABLE t1;
+
+--echo # End of 6.0 tests
+
Attachment: [text/bzr-bundle] bzr/kostja@sun.com-20091209092936-s105zxtxd3rw2y8m.bundle
| Thread |
|---|
| • bzr commit into mysql-5.6-next-mr branch (kostja:3010) Bug#46452 | Konstantin Osipov | 9 Dec |