summaryrefslogtreecommitdiff
path: root/mysql-test/t/myisam.test
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2010-03-02 13:45:50 +0400
committerSergey Vojtovich <svoj@sun.com>2010-03-02 13:45:50 +0400
commita82cc50958887464bc87e035593bb9f9fbd14d46 (patch)
treea52acd9a5f32869d6cb552ec94d5972ea14911d5 /mysql-test/t/myisam.test
parent6f78ef71d485fb3968355941860d012fc17a9c59 (diff)
downloadmariadb-git-a82cc50958887464bc87e035593bb9f9fbd14d46.tar.gz
BUG#51307 - widespread corruption with partitions and
insert...select Queries following bulk insert into an empty MyISAM table may break it. This was pure MyISAM problem. When bulk insert into an empty table is complete, MyISAM may want to enable indexes via repair by sort. If repair by sort fails (e.g. insufficient buffer), MyISAM failover to repair with key cache, requesting repair of data file. Repair of data file performs data file substitution. This means that current table instance will point to new data file. Other cached table instances are still pointing to an old, deleted data file. This is fixed by not requesting repair of data file during enable indexes. Explicit REPAIR is not affected, since it flushes all table instances. mysql-test/r/myisam.result: A test case for BUG#51307. mysql-test/t/myisam.test: A test case for BUG#51307. storage/myisam/ha_myisam.cc: When enabling indexes do not attempt to repair data file.
Diffstat (limited to 'mysql-test/t/myisam.test')
-rw-r--r--mysql-test/t/myisam.test28
1 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index d12dbce1cc1..114e0367d51 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -1587,5 +1587,33 @@ REPLACE INTO t1 VALUES
CHECK TABLE t1;
DROP TABLE t1;
+--echo #
+--echo # BUG#51307 - widespread corruption with partitions and insert...select
+--echo #
+CREATE TABLE t1(a CHAR(255), KEY(a));
+SELECT * FROM t1, t1 AS a1;
+SET myisam_sort_buffer_size=4;
+INSERT INTO t1 VALUES
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),('0'),
+('0'),('0'),('0'),('0'),('0'),('0'),('0');
+SET myisam_sort_buffer_size=@@global.myisam_sort_buffer_size;
+INSERT INTO t1 VALUES('1');
+SELECT * FROM t1, t1 AS a1 WHERE t1.a=1 AND a1.a=1;
+DROP TABLE t1;
+
--echo End of 5.1 tests