summaryrefslogtreecommitdiff
path: root/myisam/mi_open.c
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2002-07-09 22:42:44 +0200
committerunknown <serg@sergbook.mysql.com>2002-07-09 22:42:44 +0200
commit9a1ff13ea4a494d90b505b6d6e7b288d7390b5d0 (patch)
tree24ca43f7a6c86acdb12db664cbd8aaa5679c88e6 /myisam/mi_open.c
parent79bdeb9df8d1ea0810bcc0f2e36b3690c9799a33 (diff)
downloadmariadb-git-9a1ff13ea4a494d90b505b6d6e7b288d7390b5d0.tar.gz
mi_fix_rec_buff_for_blob() generalized a bit
myisam/mi_extra.c: make use of new mi_fix_rec_buff_for_blob(), and fix a (possible) bug myisam/mi_open.c: make use of new mi_fix_rec_buff_for_blob()
Diffstat (limited to 'myisam/mi_open.c')
-rw-r--r--myisam/mi_open.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index e36a52db92b..c417186de6a 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -506,20 +506,10 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
/* Allocate buffer for one record */
- extra=0;
- if (share->options & HA_OPTION_PACK_RECORD)
- extra=ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER)+MI_SPLIT_LENGTH+
- MI_DYN_DELETE_BLOCK_HEADER;
-
- tmp_length=max(share->base.pack_reclength,share->base.max_key_length);
- info.alloced_rec_buff_length=tmp_length;
- if (!(info.rec_alloc=(byte*) my_malloc(tmp_length+extra+8,
- MYF(MY_WME | MY_ZEROFILL))))
+ /* prerequisites: bzero(info) && info->s=share; are met. */
+ if (!mi_fix_rec_buff_for_blob(&info, 0))
goto err;
- if (extra)
- info.rec_buff=info.rec_alloc+ALIGN_SIZE(MI_MAX_DYN_BLOCK_HEADER);
- else
- info.rec_buff=info.rec_alloc;
+ bzero(info.rec_alloc, info.alloced_rec_buff_length);
*m_info=info;
#ifdef THREAD