summaryrefslogtreecommitdiff
path: root/mysql-test/t/merge.test
diff options
context:
space:
mode:
authorIngo Struewing <ingo.struewing@sun.com>2010-04-26 15:44:10 +0200
committerIngo Struewing <ingo.struewing@sun.com>2010-04-26 15:44:10 +0200
commite1418b14ecc1d6c2c2ec28246be0a4a30751ba6f (patch)
tree8aacf324f654252f1a70657abb13341b6c4ea835 /mysql-test/t/merge.test
parent454c003a5c5a31a8d59ba4ab54d3b3a90a609752 (diff)
downloadmariadb-git-e1418b14ecc1d6c2c2ec28246be0a4a30751ba6f.tar.gz
Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
REPAIR TABLE ... USE_FRM crashed debug servers. A wrong assert assumed that this operation would not be executed for MERGE tables. Removed the assert. mysql-test/r/merge.result: Bug#46339 - crash on REPAIR TABLE merge table USE_FRM Added test result. mysql-test/t/merge.test: Bug#46339 - crash on REPAIR TABLE merge table USE_FRM Added test. sql/sql_table.cc: Bug#46339 - crash on REPAIR TABLE merge table USE_FRM Removed false assert.
Diffstat (limited to 'mysql-test/t/merge.test')
-rw-r--r--mysql-test/t/merge.test78
1 files changed, 78 insertions, 0 deletions
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 44b202fab97..f290803bbd2 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -1705,4 +1705,82 @@ t2 WHERE b SOUNDS LIKE e AND d = 1;
DROP TABLE t2, t1;
+--echo #
+--echo # Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
+--echo #
+--disable_warnings
+DROP TABLE IF EXISTS m1, t1;
+--enable_warnings
+#
+# Test derived from a proposal of Shane Bester.
+#
+CREATE TABLE t1 (c1 INT) ENGINE=MYISAM;
+CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1) INSERT_METHOD=LAST;
+#
+# REPAIR ... USE_FRM with LOCK TABLES.
+#
+LOCK TABLE m1 READ;
+REPAIR TABLE m1 USE_FRM;
+UNLOCK TABLES;
+#
+# REPAIR ... USE_FRM without LOCK TABLES.
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+DROP TABLE m1,t1;
+#
+# Test derived from a proposal of Matthias Leich.
+#
+# Base table is missing.
+#
+CREATE TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Create base table.
+#
+CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Normal repair as reference.
+#
+REPAIR TABLE m1;
+#
+# Cleanup.
+#
+DROP TABLE m1, t1;
+#
+# Same with temporary tables.
+#
+# Base table is missing.
+#
+CREATE TEMPORARY TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Create base table.
+#
+CREATE TEMPORARY TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
+#
+# This statement crashed the server (Bug#46339).
+#
+REPAIR TABLE m1 USE_FRM;
+#
+# Normal repair as reference.
+#
+REPAIR TABLE m1;
+#
+# Cleanup.
+#
+DROP TABLE m1, t1;
+
--echo End of 5.1 tests