Commit 0732f747 authored by monty@donna.mysql.com's avatar monty@donna.mysql.com
Browse files

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
parent 5f4a3f51
Loading
Loading
Loading
Loading
+20 −8
Original line number Diff line number Diff line
@@ -31588,17 +31588,22 @@ message to less than 80 characters so that it fits the width of a standard
terminal screen.
The return value of the main function @code{xxx()} is the function value, for
@code{long long} and @code{double} functions.  For string functions, the
string is returned in the @code{result} and @code{length} arguments.
@code{result} is a buffer at least 255 bytes long.  Set these to the contents
and length of the return value.  For example:
@code{long long} and @code{double} functions.  A string functions should
return a pointer to the result and store the length of the string in the
@code{length} arguments. @code{result} is a buffer at least 255 bytes long.
Set these to the contents and length of the return value.  For example:
@example
memcpy(result, "result string", 13);
*length = 13;
@end example
The string function return value normally also points to the result.
If your string functions that needs to return a string longer than 255
bytes, you must allocate the space for it with @code{malloc()} in your
@code{xxx_init()} function or your @code{xxx()} function and free it in
your @code{xxx_deinit()} function.  You can store the allocated memory
in the @code{ptr} slot in the @code{UDF_INIT} structure for reuse by
future @code{xxx()} calls.  @xref{UDF calling sequences}.
To indicate a return value of @code{NULL} in the main function, set
@code{is_null} to @code{1}:
@@ -40403,6 +40408,12 @@ though, so Version 3.23 is not released as a stable version yet.
@appendixsubsec Changes in release 3.23.31
@itemize @bullet
@item
Using @code{HAVING} on an empty table could produce one result row.
@item
Fixed that the @strong{MySQL} RPM is not depending on perl5 anymore.
@item
Fixed some problems with @code{HEAP} tables on windows.
@item
@code{SHOW TABLE STATUS} didn't show correct average row length for tables
bigger than 4G.
@item
@@ -40412,15 +40423,16 @@ Added option @code{MEDIUM} to @code{CHECK TABLE}.
@item
Fixed problem when using @code{DECIMAL()} keys on negative numbers.
@item
@code{HOUR()} on a @code{CHAR} column always returned @code{NULL}.
@code{HOUR()} (and some other @code{TIME} functions) on a @code{CHAR} column
always returned @code{NULL}.
@item
Fixed security bug in something (please upgrade if you are using a earlier
MySQL 3.23 version).
@item
Fixed buffer overflow bug when writing a certain error message.
@item
Added usage of @code{getrlimit()} on Linux to get @code{-O --open-files-limit=#}
to work on Linux.
Added usage of @code{getrlimit()} on Linux to get @code{-O
--open-files-limit=#} to work on Linux.
@item
Added new mysqld variable: bdb_version.
@item
+5 −3
Original line number Diff line number Diff line
@@ -100,9 +100,11 @@ DO_GCOV=""
DO_GDB=""
DO_DDD=""
SLEEP_TIME=2
DBUSER=""

while test $# -gt 0; do
  case "$1" in
    --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=;;"` ;;
@@ -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 / ]
+9 −1
Original line number Diff line number Diff line
@@ -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	
+4 −0
Original line number Diff line number Diff line
b
b
b
0
+18 −4
Original line number Diff line number Diff line
@@ -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;
Loading