summaryrefslogtreecommitdiff
path: root/myisam/mi_open.c
diff options
context:
space:
mode:
authorserg@sergbook.mysql.com <>2002-07-09 22:42:44 +0200
committerserg@sergbook.mysql.com <>2002-07-09 22:42:44 +0200
commit0ae810ae85f2eadb842491f544ac8a6d61b0fd26 (patch)
tree24ca43f7a6c86acdb12db664cbd8aaa5679c88e6 /myisam/mi_open.c
parentffe18e48e545561da8c91ea0df46770f2615f500 (diff)
downloadmariadb-git-0ae810ae85f2eadb842491f544ac8a6d61b0fd26.tar.gz
mi_fix_rec_buff_for_blob() generalized a bit
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