mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BDB and LOCK TABLES
BitKeeper/deleted/.del-ib_config.h.in~9e57db8504e55b7: Delete: innobase/ib_config.h.in BitKeeper/deleted/.del-ib_config.h~7539e26ffc614439: Delete: innobase/ib_config.h Docs/manual.texi: Changelog myisam/mi_locking.c: Cleanup mysql-test/r/bdb.result: Test for LOCK TABLES mysql-test/r/innodb.result: Test for LOCK TABLES mysql-test/t/bdb.test: Test for LOCK TABLES mysql-test/t/innodb.test: Test for LOCK TABLES sql-bench/test-insert.sh: Allow loop to be small sql/ha_berkeley.cc: Fixed bug when using LOCK TABLES with BDB sql/ha_berkeley.h: Fixed bug when using LOCK TABLES with BDB sql/handler.h: Fixed bug when using LOCK TABLES with BDB sql/sql_base.cc: Fixed bug when using LOCK TABLES with BDB sql/sql_parse.cc: UNLOCK TABLES ends transaction sql/sql_select.cc: Fix to not call index_end() twice
This commit is contained in:
@ -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
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user