From cb5473cb2f0cea5eeace0fec17e0840fcba8f37a Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 9 Apr 2013 15:56:52 +0200 Subject: write frm pieces contiguously, don't align them on a 4K boundary (in partition_archive.test frm size goes down 16 times :) --- sql/unireg.cc | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'sql/unireg.cc') diff --git a/sql/unireg.cc b/sql/unireg.cc index f72658edf7f..bffe3ab7a41 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -206,24 +206,18 @@ bool mysql_create_frm(THD *thd, const char *file_name, prepare_frm_header(thd, reclength, fileinfo, create_info, keys, key_info); key_buff_length= uint4korr(fileinfo+47); - filepos= uint4korr(fileinfo+10); - { - size_t len1, len2, len3; - len1= FRM_HEADER_SIZE; // fileinfo - len1+= 7; // "form entry" - - len2= uint2korr(fileinfo+6); // 4096 - len2+= key_buff_length; - len2+= reclength; - len2+= create_info->extra_size; + frm_length= FRM_HEADER_SIZE; // fileinfo; + frm_length+= 7; // "form entry" - len3= filepos; - len3+= FRM_FORMINFO_SIZE; //forminfo - len3+= packed_fields_length(create_fields); + int2store(fileinfo+6, frm_length); + frm_length+= key_buff_length; + frm_length+= reclength; // row with default values + frm_length+= create_info->extra_size; - frm_length= len3; - } + filepos= frm_length; + frm_length+= FRM_FORMINFO_SIZE; // forminfo + frm_length+= packed_fields_length(create_fields); frm_ptr= (uchar*) my_malloc(frm_length, MYF(MY_ZEROFILL | MY_THREAD_SPECIFIC)); if (!frm_ptr) -- cgit v1.2.1