summaryrefslogtreecommitdiff
path: root/mysql-test/r/merge_mmap.result
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2010-07-02 20:07:57 +0400
committerKonstantin Osipov <kostja@sun.com>2010-07-02 20:07:57 +0400
commit05617af0251b91d886f7b9305643ee05251dd93c (patch)
tree2d39cc95922fe9199dfd5249c3f67c9b67890eed /mysql-test/r/merge_mmap.result
parent1afe6ff03aea2be84b3d060d78a091a040c93496 (diff)
downloadmariadb-git-05617af0251b91d886f7b9305643ee05251dd93c.tar.gz
A fix and a test case for Bug#36171 "CREATE TEMPORARY TABLE and
MERGE engine". Backport the patch from 6.0 by Ingo Struewing: revid:ingo.struewing@sun.com-20091028183659-6kmv1k3gdq6cpg4d Bug#36171 - CREATE TEMPORARY TABLE and MERGE engine In former MySQL versions, up to 5.1.23/6.0.4 it was possible to create temporary MERGE tables with non-temporary MyISAM tables. This has been changed in the mentioned version due to Bug 19627 (temporary merge table locking). MERGE children were locked through the parent table. If the parent was temporary, it was not locked and so the children were not locked either. Parallel use of the MyISAM tables corrupted them. Since 6.0.6 (WL 4144 - Lock MERGE engine children), the children are locked independently from the parent. Now it is possible to allow non-temporary children with a temporary parent. Even though the temporary MERGE table itself is not locked, each non-temporary MyISAM table is locked anyway. NOTE: Behavior change: In 5.1.23/6.0.4 we prohibited non-temporary children with a temporary MERGE table. Now we re-allow it. An important side-effect is that temporary tables, which overlay non-temporary MERGE children, overlay the children in the MERGE table. mysql-test/r/merge.result: Update results (Bug#36171). mysql-test/r/merge_mmap.result: Update results (Bug#36171). mysql-test/t/merge.test: Add tests for Bug#36171 mysql-test/t/merge_mmap.test: Add tests for Bug#36171. storage/myisammrg/ha_myisammrg.cc: Changed constraint for temporary state of tables.
Diffstat (limited to 'mysql-test/r/merge_mmap.result')
-rw-r--r--mysql-test/r/merge_mmap.result126
1 files changed, 126 insertions, 0 deletions
diff --git a/mysql-test/r/merge_mmap.result b/mysql-test/r/merge_mmap.result
index d975a1be377..e8014259a4a 100644
--- a/mysql-test/r/merge_mmap.result
+++ b/mysql-test/r/merge_mmap.result
@@ -32,6 +32,66 @@ c1
DROP TABLE m2, m1, t2, t1;
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
+CREATE TEMPORARY TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+CREATE TABLE m2 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2), (3), (4);
+INSERT INTO m2 SELECT * FROM m1;
+SELECT * FROM m2;
+c1
+1
+2
+3
+4
+1
+2
+3
+4
+DROP TABLE m2, m1, t2, t1;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+CREATE TEMPORARY TABLE m2 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2), (3), (4);
+INSERT INTO m2 SELECT * FROM m1;
+SELECT * FROM m2;
+c1
+1
+2
+3
+4
+1
+2
+3
+4
+DROP TABLE m2, m1, t2, t1;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE TEMPORARY TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+CREATE TEMPORARY TABLE m2 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2), (3), (4);
+INSERT INTO m2 SELECT * FROM m1;
+SELECT * FROM m2;
+c1
+1
+2
+3
+4
+1
+2
+3
+4
+DROP TABLE m2, m1, t2, t1;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
INSERT_METHOD=LAST;
CREATE TABLE m2 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
@@ -61,4 +121,70 @@ c1
4
UNLOCK TABLES;
DROP TABLE m2, m1, t2, t1;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE TEMPORARY TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+CREATE TABLE m2 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+LOCK TABLE m1 WRITE, m2 WRITE;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2), (3), (4);
+INSERT INTO m2 SELECT * FROM m1;
+SELECT * FROM m2;
+c1
+1
+2
+3
+4
+1
+2
+3
+4
+UNLOCK TABLES;
+DROP TABLE m2, m1, t2, t1;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+CREATE TEMPORARY TABLE m2 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+LOCK TABLE m1 WRITE, m2 WRITE;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2), (3), (4);
+INSERT INTO m2 SELECT * FROM m1;
+SELECT * FROM m2;
+c1
+1
+2
+3
+4
+1
+2
+3
+4
+UNLOCK TABLES;
+DROP TABLE m2, m1, t2, t1;
+CREATE TABLE t1 (c1 INT);
+CREATE TABLE t2 (c1 INT);
+CREATE TEMPORARY TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+CREATE TEMPORARY TABLE m2 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1,t2)
+INSERT_METHOD=LAST;
+LOCK TABLE m1 WRITE, m2 WRITE;
+INSERT INTO t1 VALUES (1);
+INSERT INTO t2 VALUES (2), (3), (4);
+INSERT INTO m2 SELECT * FROM m1;
+SELECT * FROM m2;
+c1
+1
+2
+3
+4
+1
+2
+3
+4
+UNLOCK TABLES;
+DROP TABLE m2, m1, t2, t1;
End of 6.0 tests