diff options
author | unknown <monty@hundin.mysql.fi> | 2001-09-08 20:45:53 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-09-08 20:45:53 +0300 |
commit | 851bea0e88c0148b87eda3b32d287ef3211b262f (patch) | |
tree | ace5d8956a44c55c16f2016294db718ae8fb43a1 /mysql-test | |
parent | 8e9c21de2ba0a41ba81ce14f0c5bbaa2187015b3 (diff) | |
download | mariadb-git-851bea0e88c0148b87eda3b32d287ef3211b262f.tar.gz |
Fix bugs when using LOCK TABLES with BDB tables
Optimized remove of key when using internal cursor in BDB tables.
mysql-test/r/bdb.result:
Test for LOCK bug
mysql-test/t/bdb.test:
Test for LOCK bug
sql/ha_berkeley.cc:
Fix bugs when using LOCK TABLES
Optimized remove of key when using internal cursor
sql/ha_berkeley.h:
Initilize of changed_rows
sql/lock.cc:
Fix for BDB tables
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/bdb.result | 3 | ||||
-rw-r--r-- | mysql-test/t/bdb.test | 27 |
2 files changed, 22 insertions, 8 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/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; |