summaryrefslogtreecommitdiff
path: root/myisam/mi_open.c
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2002-10-28 22:52:02 +0100
committerunknown <serg@serg.mysql.com>2002-10-28 22:52:02 +0100
commit05512a01452f8bd128842cc05e496fe00d21e8f4 (patch)
tree1be1c6f6d38f860705ff4fb62f952935c326baee /myisam/mi_open.c
parent43abd169b081479cb6ce1ad510a2620a2bb50db8 (diff)
downloadmariadb-git-05512a01452f8bd128842cc05e496fe00d21e8f4.tar.gz
fixed MyISAM crash on dynamic-row tables with huge number of to-be-packed fields
Diffstat (limited to 'myisam/mi_open.c')
-rw-r--r--myisam/mi_open.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/myisam/mi_open.c b/myisam/mi_open.c
index d53c39daec4..65e4fe86657 100644
--- a/myisam/mi_open.c
+++ b/myisam/mi_open.c
@@ -495,7 +495,8 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
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);
+ tmp_length=max(share->base.pack_reclength+share->base.pack_bits,
+ 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))))