mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
A fix (bug #6878: Crash with engine=memory).
heap/hp_create.c: A fix (bug #6878: Crash with engine=memory). Record length should be >= sizeof(byte*).
This commit is contained in:
@@ -41,6 +41,13 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
|
|||||||
{
|
{
|
||||||
HP_KEYDEF *keyinfo;
|
HP_KEYDEF *keyinfo;
|
||||||
DBUG_PRINT("info",("Initializing new table"));
|
DBUG_PRINT("info",("Initializing new table"));
|
||||||
|
|
||||||
|
/*
|
||||||
|
We have to store sometimes byte* del_link in records,
|
||||||
|
so the record length should be at least sizeof(byte*)
|
||||||
|
*/
|
||||||
|
set_if_bigger(reclength, sizeof (byte*));
|
||||||
|
|
||||||
for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++)
|
for (i= key_segs= max_length= 0, keyinfo= keydef; i < keys; i++, keyinfo++)
|
||||||
{
|
{
|
||||||
bzero((char*) &keyinfo->block,sizeof(keyinfo->block));
|
bzero((char*) &keyinfo->block,sizeof(keyinfo->block));
|
||||||
|
@@ -240,3 +240,12 @@ SELECT * FROM t1;
|
|||||||
pseudo date
|
pseudo date
|
||||||
ZoomZip 1101106546
|
ZoomZip 1101106546
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
create table t1(a char(2)) engine=memory;
|
||||||
|
insert into t1 values (NULL), (NULL);
|
||||||
|
delete from t1 where a is null;
|
||||||
|
insert into t1 values ('2'), ('3');
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
3
|
||||||
|
2
|
||||||
|
drop table t1;
|
||||||
|
@@ -185,3 +185,13 @@ DELETE FROM t1 WHERE date<1101106546;
|
|||||||
SELECT * FROM t1;
|
SELECT * FROM t1;
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #6878: a problem with small length records
|
||||||
|
#
|
||||||
|
|
||||||
|
create table t1(a char(2)) engine=memory;
|
||||||
|
insert into t1 values (NULL), (NULL);
|
||||||
|
delete from t1 where a is null;
|
||||||
|
insert into t1 values ('2'), ('3');
|
||||||
|
select * from t1;
|
||||||
|
drop table t1;
|
||||||
|
Reference in New Issue
Block a user