Removed bdb test cases.

parent e8289bfb
...@@ -45,7 +45,7 @@ noinst_HEADERS = embedded_priv.h emb_qcache.h ...@@ -45,7 +45,7 @@ noinst_HEADERS = embedded_priv.h emb_qcache.h
sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \
ha_heap.cc ha_myisam.cc ha_myisammrg.cc \ ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
ha_innodb.cc ha_berkeley.cc ha_federated.cc ha_ndbcluster.cc \ ha_innodb.cc ha_federated.cc ha_ndbcluster.cc \
ha_ndbcluster_binlog.cc ha_partition.cc \ ha_ndbcluster_binlog.cc ha_partition.cc \
handler.cc sql_handler.cc \ handler.cc sql_handler.cc \
hostname.cc init.cc password.c \ hostname.cc init.cc password.c \
...@@ -96,10 +96,6 @@ yassl_inc_libs= $(top_srcdir)/extra/yassl/src/.libs/libyassl.a \ ...@@ -96,10 +96,6 @@ yassl_inc_libs= $(top_srcdir)/extra/yassl/src/.libs/libyassl.a \
endif endif
# Storage engine specific compilation options # Storage engine specific compilation options
ha_berkeley.o: ha_berkeley.cc
$(CXXCOMPILE) $(LM_CFLAGS) -c $<
ha_ndbcluster.o:ha_ndbcluster.cc ha_ndbcluster.o:ha_ndbcluster.cc
$(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $< $(CXXCOMPILE) @ndbcluster_includes@ $(LM_CFLAGS) -c $<
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
# #
-- source include/not_embedded.inc -- source include/not_embedded.inc
-- source include/have_bdb.inc
-- source include/have_innodb.inc -- source include/have_innodb.inc
-- source include/have_debug.inc -- source include/have_debug.inc
...@@ -12,7 +11,7 @@ drop table if exists t1, t2; ...@@ -12,7 +11,7 @@ drop table if exists t1, t2;
--enable_warnings --enable_warnings
reset master; reset master;
create table t1 (a int) engine=bdb; create table t1 (a int) engine=innodb;
create table t2 (a int) engine=innodb; create table t2 (a int) engine=innodb;
begin; begin;
insert t1 values (5); insert t1 values (5);
......
-- require r/have_bdb.require
disable_query_log;
show variables like "have_bdb";
enable_query_log;
drop table if exists t1;
create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) engine=BDB;
insert into t1 values(1, 't1',4,9);
insert into t1 values(2, 'metatable',1,9);
insert into t1 values(3, 'metaindex',1,9 );
select * from t1;
objid tablename oid test
1 t1 4 9
2 metatable 1 9
3 metaindex 1 9
alter table t1 drop column test;
select * from t1;
objid tablename oid
1 t1 4
2 metatable 1
3 metaindex 1
drop table t1;
drop table if exists t1;
CREATE TABLE t1 (
ChargeID int(10) unsigned NOT NULL auto_increment,
ServiceID int(10) unsigned DEFAULT '0' NOT NULL,
ChargeDate date DEFAULT '0000-00-00' NOT NULL,
ChargeAmount decimal(20,2) DEFAULT '0.00' NOT NULL,
FedTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
ProvTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
ChargeStatus enum('New','Auth','Unauth','Sale','Denied','Refund')
DEFAULT 'New' NOT NULL,
ChargeAuthorizationMessage text,
ChargeComment text,
ChargeTimeStamp varchar(20),
PRIMARY KEY (ChargeID),
KEY ServiceID (ServiceID),
KEY ChargeDate (ChargeDate)
) engine=BDB;
BEGIN;
INSERT INTO t1
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
COMMIT;
BEGIN;
UPDATE t1 SET ChargeAuthorizationMessage = 'blablabla' WHERE
ChargeID = 1;
COMMIT;
INSERT INTO t1
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
select * from t1;
ChargeID ServiceID ChargeDate ChargeAmount FedTaxes ProvTaxes ChargeStatus ChargeAuthorizationMessage ChargeComment ChargeTimeStamp
1 1 2001-03-01 1.00 1.00 1.00 New blablabla NULL now
2 1 2001-03-01 1.00 1.00 1.00 New NULL NULL now
drop table t1;
create table t1 (a int) engine=bdb;
set autocommit=0;
insert into t1 values(1);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
drop table t1;
drop table if exists t1,t2;
create table t1 (id integer, x integer) engine=BDB;
create table t2 (id integer, x integer) engine=BDB;
insert into t1 values(0, 0);
insert into t2 values(0, 0);
set autocommit=0;
update t1 set x = 1 where id = 0;
set autocommit=0;
update t2 set x = 1 where id = 0;
select x from t1 where id = 0;
select x from t2 where id = 0;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
commit;
x
1
commit;
select * from t1;
id x
0 1
select * from t2;
id x
0 1
commit;
select * from t1;
id x
0 1
select * from t2;
id x
0 1
commit;
drop table t1,t2;
This diff is collapsed.
drop table if exists t1, t2, t3;
flush status;
set autocommit=0;
create table t1 (a int not null) engine=bdb;
insert into t1 values (1),(2),(3);
select * from t1;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
drop table t1;
set autocommit=1;
create table t1 (a int not null) engine=bdb;
begin;
insert into t1 values (1),(2),(3);
select * from t1;
a
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
drop table t1;
create table t1 (a int not null) engine=bdb;
create table t2 (a int not null) engine=bdb;
create table t3 (a int not null) engine=bdb;
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1),(2);
select * from t1;
a
1
2
select * from t2;
a
1
2
select * from t3;
a
1
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
begin;
select * from t1;
a
1
2
select * from t2;
a
1
2
select * from t3;
a
1
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
insert into t1 values (3);
insert into t2 values (3);
insert into t1 values (4);
select * from t1;
a
1
2
3
4
select * from t2;
a
1
2
3
select * from t3;
a
1
2
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 0
commit;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
drop table if exists t1, t2, t3;
This diff is collapsed.
...@@ -12,7 +12,7 @@ master-bin.000001 367 Xid 1 394 COMMIT /* XID */ ...@@ -12,7 +12,7 @@ master-bin.000001 367 Xid 1 394 COMMIT /* XID */
drop table t1; drop table t1;
drop table if exists t1, t2; drop table if exists t1, t2;
reset master; reset master;
create table t1 (a int) engine=bdb; create table t1 (a int) engine=innodb;
create table t2 (a int) engine=innodb; create table t2 (a int) engine=innodb;
begin; begin;
insert t1 values (5); insert t1 values (5);
...@@ -22,11 +22,11 @@ insert t2 values (5); ...@@ -22,11 +22,11 @@ insert t2 values (5);
commit; commit;
show binlog events from 102; show binlog events from 102;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=bdb master-bin.000001 # Query 1 # use `test`; create table t1 (a int) engine=innodb
master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb master-bin.000001 # Query 1 # use `test`; create table t2 (a int) engine=innodb
master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert t1 values (5) master-bin.000001 # Query 1 # use `test`; insert t1 values (5)
master-bin.000001 # Query 1 # use `test`; COMMIT master-bin.000001 # Xid 1 # COMMIT /* xid= */
master-bin.000001 # Query 1 # use `test`; BEGIN master-bin.000001 # Query 1 # use `test`; BEGIN
master-bin.000001 # Query 1 # use `test`; insert t2 values (5) master-bin.000001 # Query 1 # use `test`; insert t2 values (5)
master-bin.000001 # Xid 1 # COMMIT /* xid= */ master-bin.000001 # Xid 1 # COMMIT /* xid= */
......
...@@ -479,7 +479,7 @@ drop table t1; ...@@ -479,7 +479,7 @@ drop table t1;
create table t1 ( create table t1 (
c char(10) character set utf8, c char(10) character set utf8,
unique key a (c(1)) unique key a (c(1))
) engine=bdb; ) engine=innodb;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa'); insert into t1 values ('aa');
ERROR 23000: Duplicate entry 'aa' for key 'a' ERROR 23000: Duplicate entry 'aa' for key 'a'
...@@ -637,7 +637,7 @@ drop table t1; ...@@ -637,7 +637,7 @@ drop table t1;
create table t1 ( create table t1 (
c char(10) character set utf8 collate utf8_bin, c char(10) character set utf8 collate utf8_bin,
unique key a (c(1)) unique key a (c(1))
) engine=bdb; ) engine=innodb;
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
insert into t1 values ('aa'); insert into t1 values ('aa');
ERROR 23000: Duplicate entry 'aa' for key 'a' ERROR 23000: Duplicate entry 'aa' for key 'a'
...@@ -707,7 +707,7 @@ drop table t1; ...@@ -707,7 +707,7 @@ drop table t1;
create table t1 ( create table t1 (
str varchar(255) character set utf8 not null, str varchar(255) character set utf8 not null,
key str (str(2)) key str (str(2))
) engine=bdb; ) engine=innodb;
INSERT INTO t1 VALUES ('str'); INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2'); INSERT INTO t1 VALUES ('str2');
select * from t1 where str='str'; select * from t1 where str='str';
...@@ -796,7 +796,7 @@ insert into t1 values(1,'foo'),(2,'foobar'); ...@@ -796,7 +796,7 @@ insert into t1 values(1,'foo'),(2,'foobar');
select * from t1 where b like 'foob%'; select * from t1 where b like 'foob%';
a b a b
2 foobar 2 foobar
alter table t1 engine=bdb; alter table t1 engine=innodb;
select * from t1 where b like 'foob%'; select * from t1 where b like 'foob%';
a b a b
2 foobar 2 foobar
......
Variable_name Value
have_bdb YES
drop table if exists t1;
create table t1 (
pk int primary key,
key1 int,
key2 int,
filler char(200),
filler2 char(200),
index(key1),
index(key2)
) engine=bdb;
select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
pk key1 key2 filler filler2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
9 9 9 filler-data filler-data-2
10 10 10 filler-data filler-data-2
4 4 4 filler-data filler-data-2
5 5 5 filler-data filler-data-2
6 6 6 filler-data filler-data-2
7 7 7 filler-data filler-data-2
8 8 8 filler-data filler-data-2
set @maxv=1000;
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or key1=18 or key1=60;
pk key1 key2 filler filler2
18 18 18 filler-data filler-data-2
60 60 60 filler-data filler-data-2
1 1 1 filler-data filler-data-2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
4 4 4 filler-data filler-data-2
11 11 11 filler-data filler-data-2
12 12 12 filler-data filler-data-2
13 13 13 filler-data filler-data-2
14 14 14 filler-data filler-data-2
50 50 50 filler-data filler-data-2
51 51 51 filler-data filler-data-2
52 52 52 filler-data filler-data-2
53 53 53 filler-data filler-data-2
54 54 54 filler-data filler-data-2
991 991 991 filler-data filler-data-2
992 992 992 filler-data filler-data-2
993 993 993 filler-data filler-data-2
994 994 994 filler-data filler-data-2
995 995 995 filler-data filler-data-2
996 996 996 filler-data filler-data-2
997 997 997 filler-data filler-data-2
998 998 998 filler-data filler-data-2
999 999 999 filler-data filler-data-2
1000 1000 1000 filler-data filler-data-2
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or key1 < 3 or key1 > @maxv-11;
pk key1 key2 filler filler2
990 990 990 filler-data filler-data-2
1 1 1 filler-data filler-data-2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
4 4 4 filler-data filler-data-2
11 11 11 filler-data filler-data-2
12 12 12 filler-data filler-data-2
13 13 13 filler-data filler-data-2
14 14 14 filler-data filler-data-2
50 50 50 filler-data filler-data-2
51 51 51 filler-data filler-data-2
52 52 52 filler-data filler-data-2
53 53 53 filler-data filler-data-2
54 54 54 filler-data filler-data-2
991 991 991 filler-data filler-data-2
992 992 992 filler-data filler-data-2
993 993 993 filler-data filler-data-2
994 994 994 filler-data filler-data-2
995 995 995 filler-data filler-data-2
996 996 996 filler-data filler-data-2
997 997 997 filler-data filler-data-2
998 998 998 filler-data filler-data-2
999 999 999 filler-data filler-data-2
1000 1000 1000 filler-data filler-data-2
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or
(key1 < 5) or (key1 > 10 and key1 < 15) or (key1 >= 50 and key1 < 55 ) or (key1 > @maxv-10);
pk key1 key2 filler filler2
1 1 1 filler-data filler-data-2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
4 4 4 filler-data filler-data-2
11 11 11 filler-data filler-data-2
12 12 12 filler-data filler-data-2
13 13 13 filler-data filler-data-2
14 14 14 filler-data filler-data-2
50 50 50 filler-data filler-data-2
51 51 51 filler-data filler-data-2
52 52 52 filler-data filler-data-2
53 53 53 filler-data filler-data-2
54 54 54 filler-data filler-data-2
991 991 991 filler-data filler-data-2
992 992 992 filler-data filler-data-2
993 993 993 filler-data filler-data-2
994 994 994 filler-data filler-data-2
995 995 995 filler-data filler-data-2
996 996 996 filler-data filler-data-2
997 997 997 filler-data filler-data-2
998 998 998 filler-data filler-data-2
999 999 999 filler-data filler-data-2
1000 1000 1000 filler-data filler-data-2
select * from t1 where
(pk > 10 and pk < 15) or (pk >= 50 and pk < 55 )
or
(key1 < 5) or (key1 > @maxv-10);
pk key1 key2 filler filler2
1 1 1 filler-data filler-data-2
2 2 2 filler-data filler-data-2
3 3 3 filler-data filler-data-2
4 4 4 filler-data filler-data-2
991 991 991 filler-data filler-data-2
992 992 992 filler-data filler-data-2
993 993 993 filler-data filler-data-2
994 994 994 filler-data filler-data-2
995 995 995 filler-data filler-data-2
996 996 996 filler-data filler-data-2
997 997 997 filler-data filler-data-2
998 998 998 filler-data filler-data-2
999 999 999 filler-data filler-data-2
1000 1000 1000 filler-data filler-data-2
11 11 11 filler-data filler-data-2
12 12 12 filler-data filler-data-2
13 13 13 filler-data filler-data-2
14 14 14 filler-data filler-data-2
50 50 50 filler-data filler-data-2
51 51 51 filler-data filler-data-2
52 52 52 filler-data filler-data-2
53 53 53 filler-data filler-data-2
54 54 54 filler-data filler-data-2
drop table t1;
This diff is collapsed.
drop table if exists t1, t2, t3,t4;
create table t1 (
pk1 int not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb;
insert into t1 values (-5, 1, 1),
(-100, 1, 1),
(3, 1, 1),
(0, 1, 1),
(10, 1, 1);
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge key1,key2 key1,key2 5,5 NULL 5 Using sort_union(key1,key2); Using where
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 key1 key2
-100 1 1
-5 1 1
0 1 1
3 1 1
10 1 1
drop table t1;
create table t1 (
pk1 int unsigned not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb;
insert into t1 values (0, 1, 1),
(0xFFFFFFFF, 1, 1),
(0xFFFFFFFE, 1, 1),
(1, 1, 1),
(2, 1, 1);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 key1 key2
0 1 1
1 1 1
2 1 1
4294967294 1 1
4294967295 1 1
drop table t1;
create table t1 (
pk1 char(4) not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb collate latin2_general_ci;
insert into t1 values ('a1', 1, 1),
('b2', 1, 1),
('A3', 1, 1),
('B4', 1, 1);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 key1 key2
a1 1 1
A3 1 1
b2 1 1
B4 1 1
drop table t1;
create table t1 (
pk1 int not NULL,
pk2 char(4) not NULL collate latin1_german1_ci,
pk3 char(4) not NULL collate latin1_bin,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1,pk2,pk3),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb;
insert into t1 values
(1, 'u', 'u', 1, 1),
(1, 'u', char(0xEC), 1, 1),
(1, 'u', 'x', 1, 1);
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
select * from t1;
pk1 pk2 pk3 key1 key2
1 u 1 1
1 x 1 1
1 1 1
1 u u 1 1
1 u x 1 1
1 u 1 1
1 x u 1 1
1 x x 1 1
1 x 1 1
2 u 1 1
2 x 1 1
2 1 1
2 u u 1 1
2 u x 1 1
2 u 1 1
2 x u 1 1
2 x x 1 1
2 x 1 1
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 pk2 pk3 key1 key2
1 u 1 1
1 x 1 1
1 1 1
1 u u 1 1
1 u x 1 1
1 u 1 1
1 x u 1 1
1 x x 1 1
1 x 1 1
2 u 1 1
2 x 1 1
2 1 1
2 u u 1 1
2 u x 1 1
2 u 1 1
2 x u 1 1
2 x x 1 1
2 x 1 1
alter table t1 drop primary key;
select * from t1;
pk1 pk2 pk3 key1 key2
1 u 1 1
1 x 1 1
1 1 1
1 u u 1 1
1 u x 1 1
1 u 1 1
1 x u 1 1
1 x x 1 1
1 x 1 1
2 u 1 1
2 x 1 1
2 1 1
2 u u 1 1
2 u x 1 1
2 u 1 1
2 x u 1 1
2 x x 1 1
2 x 1 1
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 pk2 pk3 key1 key2
1 u 1 1
1 x 1 1
1 1 1
1 u u 1 1
1 u x 1 1
1 u 1 1
1 x u 1 1
1 x x 1 1
1 x 1 1
2 u 1 1
2 x 1 1
2 1 1
2 u u 1 1
2 u x 1 1
2 u 1 1
2 x u 1 1
2 x x 1 1
2 x 1 1
drop table t1;
create table t1 (
pk1 varchar(8) NOT NULL default '',
pk2 varchar(4) NOT NULL default '',
key1 int(11),
key2 int(11),
primary key(pk1, pk2),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb;
insert into t1 values ('','empt',2,2),
('a','a--a',2,2),
('bb','b--b',2,2),
('ccc','c--c',2,2),
('dddd','d--d',2,2);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
pk1 pk2 key1 key2
empt 2 2
a a--a 2 2
bb b--b 2 2
ccc c--c 2 2
dddd d--d 2 2
drop table t1;
#
# Test of problem when shutting down mysqld at once after ALTER TABLE
#
-- source include/have_bdb.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1(objid BIGINT not null, tablename varchar(64), oid BIGINT not null, test BIGINT, PRIMARY KEY (objid), UNIQUE(tablename)) engine=BDB;
insert into t1 values(1, 't1',4,9);
insert into t1 values(2, 'metatable',1,9);
insert into t1 values(3, 'metaindex',1,9 );
select * from t1;
alter table t1 drop column test;
# Now we do a reboot and continue with the next test
# End of 4.1 tests
#
# Note that this test uses tables from the previous test
# This is to test that the table t1 survives a reboot of MySQL
# The options in the -master.opt file are just there to force the reboot
#
-- source include/have_bdb.inc
select * from t1;
drop table t1;
# End of 4.1 tests
-- source include/have_bdb.inc
# test for bug reported by Mark Steele
--disable_warnings
drop table if exists t1;
--enable_warnings
CREATE TABLE t1 (
ChargeID int(10) unsigned NOT NULL auto_increment,
ServiceID int(10) unsigned DEFAULT '0' NOT NULL,
ChargeDate date DEFAULT '0000-00-00' NOT NULL,
ChargeAmount decimal(20,2) DEFAULT '0.00' NOT NULL,
FedTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
ProvTaxes decimal(20,2) DEFAULT '0.00' NOT NULL,
ChargeStatus enum('New','Auth','Unauth','Sale','Denied','Refund')
DEFAULT 'New' NOT NULL,
ChargeAuthorizationMessage text,
ChargeComment text,
ChargeTimeStamp varchar(20),
PRIMARY KEY (ChargeID),
KEY ServiceID (ServiceID),
KEY ChargeDate (ChargeDate)
) engine=BDB;
BEGIN;
INSERT INTO t1
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
COMMIT;
BEGIN;
UPDATE t1 SET ChargeAuthorizationMessage = 'blablabla' WHERE
ChargeID = 1;
COMMIT;
INSERT INTO t1
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
select * from t1;
drop table t1;
#
# Test for bug #2342 "Running ANALYZE TABLE on bdb table
# inside a transaction hangs server thread"
create table t1 (a int) engine=bdb;
set autocommit=0;
insert into t1 values(1);
analyze table t1;
drop table t1;
# End of 4.1 tests
# This test doesn't work with the embedded version as this code
# assumes that one query is running while we are doing queries on
# a second connection.
# This would work if mysqltest run would be threaded and handle each
# connection in a separate thread.
#
-- source include/not_embedded.inc
-- source include/have_bdb.inc
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
connection con1;
create table t1 (id integer, x integer) engine=BDB;
create table t2 (id integer, x integer) engine=BDB;
insert into t1 values(0, 0);
insert into t2 values(0, 0);
set autocommit=0;
update t1 set x = 1 where id = 0;
connection con2;
set autocommit=0;
update t2 set x = 1 where id = 0;
# The following query should hang because con1 is locking the page
--send
select x from t1 where id = 0;
connection con1;
# This should generate a deadlock as we are trying to access a locked row
--send
select x from t2 where id = 0;
connection con2;
--error 1213
reap;
commit;
connection con1;
reap;
commit;
connection con2;
select * from t1;
select * from t2;
commit;
connection con1;
select * from t1;
select * from t2;
commit;
drop table t1,t2;
# End of 4.1 tests
# This test doesn't work with the embedded version as this code
# assumes that one query is running while we are doing queries on
# a second connection.
# This would work if mysqltest run would be threaded and handle each
# connection in a separate thread.
#
#-- source include/not_embedded.inc
-- source include/have_bdb.inc
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
connection con1;
create table t1 (id integer, x integer) engine=BDB;
create table t2 (id integer, x integer) engine=BDB;
insert into t1 values(0, 0);
insert into t2 values(0, 0);
set autocommit=0;
update t1 set x = 1 where id = 0;
connection con2;
set autocommit=0;
update t2 set x = 1 where id = 0;
# The following query should hang because con1 is locking the page
--send
select x from t1 where id = 0;
connection con1;
# This should generate a deadlock as we are trying to access a locked row
--send
select x from t2 where id = 0;
connection con2;
--error 1213
reap;
commit;
connection con1;
reap;
commit;
connection con2;
select * from t1;
select * from t2;
commit;
connection con1;
select * from t1;
select * from t2;
commit;
drop table t1,t2;
# End of 4.1 tests
This diff is collapsed.
--set-variable=query_cache_size=1M
-- source include/have_bdb.inc
-- source include/have_query_cache.inc
#
# Without auto_commit.
#
--disable_warnings
drop table if exists t1, t2, t3;
--enable_warnings
flush status;
set autocommit=0;
create table t1 (a int not null) engine=bdb;
insert into t1 values (1),(2),(3);
select * from t1;
show status like "Qcache_queries_in_cache";
drop table t1;
set autocommit=1;
create table t1 (a int not null) engine=bdb;
begin;
insert into t1 values (1),(2),(3);
select * from t1;
show status like "Qcache_queries_in_cache";
drop table t1;
create table t1 (a int not null) engine=bdb;
create table t2 (a int not null) engine=bdb;
create table t3 (a int not null) engine=bdb;
insert into t1 values (1),(2);
insert into t2 values (1),(2);
insert into t3 values (1),(2);
select * from t1;
select * from t2;
select * from t3;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
begin;
select * from t1;
select * from t2;
select * from t3;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
insert into t1 values (3);
insert into t2 values (3);
insert into t1 values (4);
select * from t1;
select * from t2;
select * from t3;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
commit;
show status like "Qcache_queries_in_cache";
drop table if exists t1, t2, t3;
# End of 4.1 tests
-- source include/have_bdb.inc
SET storage_engine=bdb;
--source include/gis_generic.inc
...@@ -360,7 +360,7 @@ drop table t1; ...@@ -360,7 +360,7 @@ drop table t1;
create table t1 ( create table t1 (
c char(10) character set utf8, c char(10) character set utf8,
unique key a (c(1)) unique key a (c(1))
) engine=bdb; ) engine=innodb;
--enable_warnings --enable_warnings
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
--error 1062 --error 1062
...@@ -483,7 +483,7 @@ drop table t1; ...@@ -483,7 +483,7 @@ drop table t1;
create table t1 ( create table t1 (
c char(10) character set utf8 collate utf8_bin, c char(10) character set utf8 collate utf8_bin,
unique key a (c(1)) unique key a (c(1))
) engine=bdb; ) engine=innodb;
--enable_warnings --enable_warnings
insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f'); insert into t1 values ('a'),('b'),('c'),('d'),('e'),('f');
--error 1062 --error 1062
...@@ -558,7 +558,7 @@ drop table t1; ...@@ -558,7 +558,7 @@ drop table t1;
create table t1 ( create table t1 (
str varchar(255) character set utf8 not null, str varchar(255) character set utf8 not null,
key str (str(2)) key str (str(2))
) engine=bdb; ) engine=innodb;
--enable_warnings --enable_warnings
INSERT INTO t1 VALUES ('str'); INSERT INTO t1 VALUES ('str');
INSERT INTO t1 VALUES ('str2'); INSERT INTO t1 VALUES ('str2');
...@@ -644,7 +644,7 @@ create table t1 ( ...@@ -644,7 +644,7 @@ create table t1 (
insert into t1 values(1,'foo'),(2,'foobar'); insert into t1 values(1,'foo'),(2,'foobar');
select * from t1 where b like 'foob%'; select * from t1 where b like 'foob%';
--disable_warnings --disable_warnings
alter table t1 engine=bdb; alter table t1 engine=innodb;
--enable_warnings --enable_warnings
select * from t1 where b like 'foob%'; select * from t1 where b like 'foob%';
drop table t1; drop table t1;
......
#
# 2-sweeps read Index_merge test
#
-- source include/have_bdb.inc
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (
pk int primary key,
key1 int,
key2 int,
filler char(200),
filler2 char(200),
index(key1),
index(key2)
) engine=bdb;
--disable_query_log
let $1=1000;
while ($1)
{
eval insert into t1 values($1, $1, $1, 'filler-data','filler-data-2');
dec $1;
}
--enable_query_log
select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 );
set @maxv=1000;
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or key1=18 or key1=60;
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or key1 < 3 or key1 > @maxv-11;
select * from t1 where
(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10)
or
(key1 < 5) or (key1 > 10 and key1 < 15) or (key1 >= 50 and key1 < 55 ) or (key1 > @maxv-10);
select * from t1 where
(pk > 10 and pk < 15) or (pk >= 50 and pk < 55 )
or
(key1 < 5) or (key1 > @maxv-10);
drop table t1;
###############################################
# #
# Prepared Statements test on BDB tables #
# #
###############################################
#
# NOTE: PLEASE SEE ps_1general.test (bottom)
# BEFORE ADDING NEW TEST CASES HERE !!!
use test;
-- source include/have_bdb.inc
let $type= 'BDB' ;
-- source include/ps_create.inc
-- source include/ps_renew.inc
-- source include/ps_query.inc
-- source include/ps_modify.inc
-- source include/ps_modify1.inc
-- source include/ps_conv.inc
drop table t1, t9;
# End of 4.1 tests
#
# Test for rowid ordering (and comparison) functions.
# do index_merge select for tables with PK of various types.
#
--disable_warnings
drop table if exists t1, t2, t3,t4;
--enable_warnings
-- source include/have_bdb.inc
# Signed number as rowid
create table t1 (
pk1 int not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb;
insert into t1 values (-5, 1, 1),
(-100, 1, 1),
(3, 1, 1),
(0, 1, 1),
(10, 1, 1);
explain select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Unsigned numbers as rowids
create table t1 (
pk1 int unsigned not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb;
insert into t1 values (0, 1, 1),
(0xFFFFFFFF, 1, 1),
(0xFFFFFFFE, 1, 1),
(1, 1, 1),
(2, 1, 1);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Case-insensitive char(N)
create table t1 (
pk1 char(4) not NULL,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb collate latin2_general_ci;
insert into t1 values ('a1', 1, 1),
('b2', 1, 1),
('A3', 1, 1),
('B4', 1, 1);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Multi-part PK
create table t1 (
pk1 int not NULL,
pk2 char(4) not NULL collate latin1_german1_ci,
pk3 char(4) not NULL collate latin1_bin,
key1 int(11),
key2 int(11),
PRIMARY KEY (pk1,pk2,pk3),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb;
insert into t1 values
(1, 'u', 'u', 1, 1),
(1, 'u', char(0xEC), 1, 1),
(1, 'u', 'x', 1, 1);
insert ignore into t1 select pk1, char(0xEC), pk3, key1, key2 from t1;
insert ignore into t1 select pk1, 'x', pk3, key1, key2 from t1 where pk2='u';
insert ignore into t1 select 2, pk2, pk3, key1, key2 from t1;
select * from t1;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
# Hidden PK
alter table t1 drop primary key;
select * from t1;
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
# Variable-length PK
# this is also test for Bug#2688
create table t1 (
pk1 varchar(8) NOT NULL default '',
pk2 varchar(4) NOT NULL default '',
key1 int(11),
key2 int(11),
primary key(pk1, pk2),
KEY key1 (key1),
KEY key2 (key2)
) engine=bdb;
insert into t1 values ('','empt',2,2),
('a','a--a',2,2),
('bb','b--b',2,2),
('ccc','c--c',2,2),
('dddd','d--d',2,2);
select * from t1 force index(key1, key2) where key1 < 3 or key2 < 3;
drop table t1;
...@@ -29,7 +29,7 @@ ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER ...@@ -29,7 +29,7 @@ ADD_DEFINITIONS(-DHAVE_ROW_BASED_REPLICATION -DMYSQL_SERVER
ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc
discover.cc ../libmysql/errmsg.c field.cc field_conv.cc discover.cc ../libmysql/errmsg.c field.cc field_conv.cc
filesort.cc gstream.cc ha_heap.cc ha_myisam.cc ha_myisammrg.cc filesort.cc gstream.cc ha_heap.cc ha_myisam.cc ha_myisammrg.cc
ha_innodb.cc ha_partition.cc ha_federated.cc ha_berkeley.cc ha_innodb.cc ha_partition.cc ha_federated.cc
handler.cc hash_filo.cc hash_filo.h handler.cc hash_filo.cc hash_filo.h
hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc hostname.cc init.cc item.cc item_buff.cc item_cmpfunc.cc
item_create.cc item_func.cc item_geofunc.cc item_row.cc item_create.cc item_func.cc item_geofunc.cc item_row.cc
......
...@@ -47,7 +47,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ ...@@ -47,7 +47,7 @@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \
item_create.h item_subselect.h item_row.h \ item_create.h item_subselect.h item_row.h \
mysql_priv.h item_geofunc.h sql_bitmap.h \ mysql_priv.h item_geofunc.h sql_bitmap.h \
procedure.h sql_class.h sql_lex.h sql_list.h \ procedure.h sql_class.h sql_lex.h sql_list.h \
sql_manager.h sql_map.h sql_string.h unireg.h \ sql_map.h sql_string.h unireg.h \
sql_error.h field.h handler.h mysqld_suffix.h \ sql_error.h field.h handler.h mysqld_suffix.h \
ha_heap.h ha_myisam.h ha_myisammrg.h ha_partition.h \ ha_heap.h ha_myisam.h ha_myisammrg.h ha_partition.h \
ha_innodb.h ha_federated.h \ ha_innodb.h ha_federated.h \
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
*/ */
#include "mysql_priv.h" #include "mysql_priv.h"
#include "sql_manager.h"
ulong volatile manager_status; ulong volatile manager_status;
bool volatile manager_thread_in_use; bool volatile manager_thread_in_use;
......
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifdef WITH_BERKELEY_STORAGE_ENGINE
void berkeley_cleanup_log_files(void);
#endif /* WITH_BERKELEY_STORAGE_ENGINE */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment