1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fixed for bugs that was found when getting full code coverage of BDB

Fixed bug with HEAP tables on windows
Fixed bug with HAVING on empty tables
This commit is contained in:
monty@donna.mysql.com
2001-01-17 03:15:20 +02:00
parent 5f4a3f5167
commit 0732f7475e
13 changed files with 193 additions and 97 deletions

View File

@ -100,10 +100,12 @@ DO_GCOV=""
DO_GDB=""
DO_DDD=""
SLEEP_TIME=2
DBUSER=""
while test $# -gt 0; do
case "$1" in
--force ) FORCE=1 ;;
--user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;;
--force) FORCE=1 ;;
--local) USE_RUNNING_SERVER="" ;;
--tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;;
--master_port=*) MASTER_MYPORT=`$ECHO "$1" | $SED -e "s;--master_port=;;"` ;;
@ -209,9 +211,9 @@ fi
if [ -n "$USE_RUNNING_SERVER" ]
then
MASTER_MYSOCK="/tmp/mysql.sock"
DBUSER=test
DBUSER=${DBUSER:-test}
else
DBUSER=root # We want to do FLUSH xxx commands
DBUSER=${DBUSER:-root} # We want to do FLUSH xxx commands
fi
if [ -w / ]

View File

@ -147,6 +147,12 @@ Table Op Msg_type Msg_text
test.t1 check error The handler for the table doesn't support check/repair
a b
2 testing
Table Op Msg_type Msg_text
test.t1 analyze status OK
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 1 skr 1 a A 3 NULL NULL
a b
1
a b
a 1
a 2
@ -429,6 +435,8 @@ count(*)
count(*)
1
count(*)
0
count(*)
1
count(*)
1
@ -468,4 +476,4 @@ hello 1
Table Op Msg_type Msg_text
test.t1 optimize status OK
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Comment
t1 0 PRIMARY 1 a A 1 NULL NULL
t1 0 PRIMARY 1 a A 2 NULL NULL

View File

@ -0,0 +1,4 @@
b
b
b
0

View File

@ -4,7 +4,7 @@
# Small basic test with ignore
#
drop table if exists t1;
drop table if exists t1,t2;
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) type=bdb;
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
@ -81,6 +81,17 @@ create table t1 (a int,b varchar(20)) type=bdb;
insert into t1 values (1,""), (2,"testing");
delete from t1 where a = 1;
select * from t1;
create index skr on t1 (a);
insert into t1 values (3,""), (4,"testing");
analyze table t1;
show keys from t1;
drop table t1;
# Test of reading on secondary key with may be null
create table t1 (a int,b varchar(20),key(a)) type=bdb;
insert into t1 values (1,""), (2,"testing");
select * from t1 where a = 1;
drop table t1;
#
@ -352,12 +363,15 @@ CREATE TABLE t1 (
INDEX sca_pic (sca_pic)
) type = bdb ;
INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'J', 'RING', 'EN', 'not null', NULL, 'RING');
INSERT INTO t1 ( sca_code, cat_code, sca_desc, lan_code, sca_pic, sca_sdesc, sca_sch_desc) VALUES ( 'PD', 'J', 'PENDANT', 'EN', NULL, NULL, 'PENDANT'),( 'RI', 'J', 'RING', 'EN', NULL, NULL, 'RING'),( 'QQ', 'N', 'RING', 'EN', 'not null', NULL, 'RING');
select count(*) from t1 where sca_code = 'PD';
select count(*) from t1 where sca_code <= 'PD';
select count(*) from t1 where sca_pic is null;
alter table t1 drop index sca_pic, add index sca_pic (cat_code, sca_pic);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where cat_code='E';
alter table t1 drop index sca_pic, add index (sca_pic, cat_code);
select count(*) from t1 where sca_code='PD' and sca_pic is null;
select count(*) from t1 where sca_pic >= 'n';
@ -385,7 +399,7 @@ flush logs;
#
# Test key on blob with null values
#
create table t1 (b blob, i int, key (b(100)), key (i), key (i, b(20)));
create table t1 (b blob, i int, key (b(100)), key (i), key (i, b(20))) type=bdb;
insert into t1 values ('this is a blob', 1), (null, -1), (null, null),("",1),("",2),("",3);
select b from t1 where b = 'this is a blob';
select * from t1 where b like 't%';
@ -399,7 +413,7 @@ drop table t1;
#
# Test with variable length primary key
#
create table t1 (a varchar(100) not null, primary key(a), b int not null);
create table t1 (a varchar(100) not null, primary key(a), b int not null) type=bdb;
insert into t1 values("hello",1),("world",2);
select * from t1 order by b desc;
optimize table t1;

10
mysql-test/t/having.test Normal file
View File

@ -0,0 +1,10 @@
# test of problems with having (Reported by Mark Rogers)
#
drop table if exists t1;
create table t1 (a int);
select count(a) as b from t1 where a=0 having b > 0;
insert into t1 values (null);
select count(a) as b from t1 where a=0 having b > 0;
select count(a) as b from t1 where a=0 having b >=0;
drop table t1;