diff options
author | unknown <serg@serg.mysql.com> | 2003-01-30 19:34:19 +0100 |
---|---|---|
committer | unknown <serg@serg.mysql.com> | 2003-01-30 19:34:19 +0100 |
commit | 2479bdeae9e48165017d07f737dc30c911d305e1 (patch) | |
tree | cb477b6110e646d1ca726a0f0b8bcf789769db2d /myisam | |
parent | 8ff6a36b167ea2edc9df1353b05a7ade24e87797 (diff) | |
download | mariadb-git-2479bdeae9e48165017d07f737dc30c911d305e1.tar.gz |
fixed crash with blobs in compressed table
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_check.c | 4 | ||||
-rw-r--r-- | myisam/mi_packrec.c | 12 | ||||
-rw-r--r-- | myisam/myisamdef.h | 3 |
3 files changed, 8 insertions, 11 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 0db09e669cf..67a7d6f363d 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -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 == diff --git a/myisam/mi_packrec.c b/myisam/mi_packrec.c index 818788a5e74..66cfd169026 100644 --- a/myisam/mi_packrec.c +++ b/myisam/mi_packrec.c @@ -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; } diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 601a9a40aea..92eead7b96c 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -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); |