Commit 00db3c39 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

fixed crash with blobs in compressed table

parent 45ed0a08
......@@ -920,7 +920,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
goto err;
start_recpos=pos;
splits++;
VOID(_mi_pack_get_block_info(info,&block_info, -1, start_recpos, NullS));
VOID(_mi_pack_get_block_info(info,&block_info, -1, start_recpos));
pos=block_info.filepos+block_info.rec_len;
if (block_info.rec_len < (uint) info->s->min_pack_length ||
block_info.rec_len > (uint) info->s->max_pack_length)
......@@ -2891,7 +2891,7 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
DBUG_RETURN(1); /* Something wrong with data */
}
sort_param->start_recpos=sort_param->pos;
if (_mi_pack_get_block_info(info,&block_info,-1,sort_param->pos, NullS))
if (_mi_pack_get_block_info(info,&block_info,-1,sort_param->pos))
DBUG_RETURN(-1);
if (!block_info.rec_len &&
sort_param->pos + MEMMAP_EXTRA_MARGIN ==
......
......@@ -416,8 +416,7 @@ int _mi_read_pack_record(MI_INFO *info, my_off_t filepos, byte *buf)
DBUG_RETURN(-1); /* _search() didn't find record */
file=info->dfile;
if (_mi_pack_get_block_info(info, &block_info, file, filepos,
info->rec_buff))
if (_mi_pack_get_block_info(info, &block_info, file, filepos))
goto err;
if (my_read(file,(byte*) info->rec_buff + block_info.offset ,
block_info.rec_len - block_info.offset, MYF(MY_NABP)))
......@@ -963,11 +962,10 @@ int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
if (_mi_read_cache(&info->rec_cache,(byte*) block_info.header,filepos,
share->pack.ref_length, skip_deleted_blocks))
goto err;
b_type=_mi_pack_get_block_info(info,&block_info,-1, filepos, NullS);
b_type=_mi_pack_get_block_info(info,&block_info,-1, filepos);
}
else
b_type=_mi_pack_get_block_info(info,&block_info,info->dfile,filepos,
info->rec_buff);
b_type=_mi_pack_get_block_info(info,&block_info,info->dfile,filepos);
if (b_type)
goto err; /* Error code is already set */
#ifndef DBUG_OFF
......@@ -1007,7 +1005,7 @@ int _mi_read_rnd_pack_record(MI_INFO *info, byte *buf,
/* Read and process header from a huff-record-file */
uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BLOCK_INFO *info, File file,
my_off_t filepos, char *rec_buff)
my_off_t filepos)
{
uchar *header=info->header;
uint head_length,ref_length;
......@@ -1067,7 +1065,7 @@ uint _mi_pack_get_block_info(MI_INFO *myisam, MI_BLOCK_INFO *info, File file,
if (file > 0)
{
info->offset=min(info->rec_len, ref_length - head_length);
memcpy(rec_buff, header+head_length, info->offset);
memcpy(myisam->rec_buff, header+head_length, info->offset);
}
return 0;
}
......
......@@ -608,8 +608,7 @@ extern "C" {
extern uint _mi_get_block_info(MI_BLOCK_INFO *,File, my_off_t);
extern uint _mi_rec_pack(MI_INFO *info,byte *to,const byte *from);
extern uint _mi_pack_get_block_info(MI_INFO *mysql, MI_BLOCK_INFO *, File,
my_off_t, char *rec_buf);
extern uint _mi_pack_get_block_info(MI_INFO *, MI_BLOCK_INFO *, File, my_off_t);
extern void _my_store_blob_length(byte *pos,uint pack_length,uint length);
extern void _myisam_log(enum myisam_log_commands command,MI_INFO *info,
const byte *buffert,uint length);
......
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