diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/bdb.result | 17 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 17 | ||||
-rw-r--r-- | mysql-test/t/bdb.test | 27 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 27 |
4 files changed, 88 insertions, 0 deletions
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result index 2e760ae5b75..5e227313e4a 100644 --- a/mysql-test/r/bdb.result +++ b/mysql-test/r/bdb.result @@ -492,3 +492,20 @@ a 1 a 2 MIN(B) MAX(b) 1 1 +id +0 +1 +2 +id +0 +1 +2 +id +0 +1 +2 +id id3 +0 0 +1 1 +2 2 +100 2 diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 12f193bbdd9..319a9095cbc 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -449,3 +449,20 @@ a 1 table type possible_keys key key_len ref rows Extra t1 range PRIMARY PRIMARY 4 NULL 1 where used +id +0 +1 +2 +id +0 +1 +2 +id +0 +1 +2 +id id3 +0 0 +1 1 +2 2 +100 2 diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test index 564491fc520..96296e238fd 100644 --- a/mysql-test/t/bdb.test +++ b/mysql-test/t/bdb.test @@ -678,3 +678,30 @@ CREATE TABLE t1 ( INSERT INTO t1 VALUES (1, 1); SELECT MIN(B),MAX(b) FROM t1 WHERE t1.a = 1; drop table t1; + +# +# Test problem with BDB and lock tables with duplicate write. +# + +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=bdb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +--error 690 +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +select id from t1; +select id from t1; +UNLOCK TABLES; +DROP TABLE t1; + +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=bdb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +begin; +--error 690 +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +select id from t1; +insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); +commit; +select id,id3 from t1; +UNLOCK TABLES; +DROP TABLE t1; diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index b18091656b6..60e29ca33c4 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -429,3 +429,30 @@ create table t1 (a int primary key,b int, c int, d int, e int, f int, g int, h insert into t1 values (1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1); explain select * from t1 where a > 0 and a < 50; drop table t1; + +# +# Test lock tables +# + +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +--error 690 +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +select id from t1; +select id from t1; +UNLOCK TABLES; +DROP TABLE t1; + +create table t1 (id int NOT NULL,id2 int NOT NULL,id3 int NOT NULL,dummy1 char(30),primary key (id,id2),index index_id3 (id3)) type=innodb; +insert into t1 values (0,0,0,'ABCDEFGHIJ'),(2,2,2,'BCDEFGHIJK'),(1,1,1,'CDEFGHIJKL'); +LOCK TABLES t1 WRITE; +begin; +--error 690 +insert into t1 values (99,1,2,'D'),(1,1,2,'D'); +select id from t1; +insert ignore into t1 values (100,1,2,'D'),(1,1,99,'D'); +commit; +select id,id3 from t1; +UNLOCK TABLES; +DROP TABLE t1; |