summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/bdb.result3
-rw-r--r--mysql-test/r/identity.result4
-rw-r--r--mysql-test/t/bdb.test27
-rw-r--r--mysql-test/t/identity.test2
-rw-r--r--mysql-test/t/merge.test2
5 files changed, 29 insertions, 9 deletions
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result
index 39b4962ef58..e66ca657484 100644
--- a/mysql-test/r/bdb.result
+++ b/mysql-test/r/bdb.result
@@ -524,3 +524,6 @@ a b a b
a b
1 1
1 2
+id id2 id3 dummy1
+id id2 id3 dummy1
+NULL NULL NULL NULL
diff --git a/mysql-test/r/identity.result b/mysql-test/r/identity.result
new file mode 100644
index 00000000000..45968248d26
--- /dev/null
+++ b/mysql-test/r/identity.result
@@ -0,0 +1,4 @@
+last_insert_id(345)
+345
+@@IDENTITY last_insert_id()
+345 345
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index 5e28c31e051..465dc9634cc 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -727,13 +727,24 @@ DROP TABLE t1,t2;
# Test problem with joining table to itself on a multi-part unique key
#
-drop table if exists t;
-create table t (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb;
-
-insert into t values (1,1), (1,2);
+drop table if exists t1;
+create table t1 (a int(11) not null, b int(11) not null, unique (a,b)) type=bdb;
+insert into t1 values (1,1), (1,2);
+select * from t1 where a = 1;
+select t1.*, t2.* from t1, t1 t2 where t1.a = t2.a and t2.a = 1;
+select * from t1 where a = 1;
+drop table t1;
-select * from t where a = 1;
-select t1.*, t2.* from t t1, t t2 where t1.a = t2.a and t2.a = 1;
-select * from t where a = 1;
+#
+# This caused a deadlock in BDB internal locks
+#
-drop table t;
+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');
+create table t2 (id int NOT NULL,primary key (id)) type=bdb;
+LOCK TABLES t1 WRITE, t2 WRITE;
+insert into t2 values(1);
+SELECT t1.* FROM t1 WHERE id IN (1);
+SELECT t1.* FROM t2 left outer join t1 on (t1.id=t2.id);
+delete from t1 where id3 >= 0 and id3 <= 0;
+drop table t1,t2;
diff --git a/mysql-test/t/identity.test b/mysql-test/t/identity.test
new file mode 100644
index 00000000000..37183fd3b35
--- /dev/null
+++ b/mysql-test/t/identity.test
@@ -0,0 +1,2 @@
+select last_insert_id(345);
+select @@IDENTITY,last_insert_id();
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 90efdfa2d33..188f699cd64 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -113,4 +113,4 @@ insert into t1 values (1,2),(2,1),(0,0),(4,4),(5,5),(6,6);
insert into t2 values (1,1),(2,2),(0,0),(4,4),(5,5),(6,6);
flush tables;
select * from t3 where a=1 order by b limit 2;
-drop table t1,t2,t3;
+drop table t3,t1,t2;