diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-04-09 15:56:52 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-04-09 15:56:52 +0200 |
commit | cb5473cb2f0cea5eeace0fec17e0840fcba8f37a (patch) | |
tree | 874def786aaa29dbc3fadd3fb1f3a21ea61d26dd /sql/unireg.cc | |
parent | e671cba9ede179a8c631e572450198dbad17aaa0 (diff) | |
download | mariadb-git-cb5473cb2f0cea5eeace0fec17e0840fcba8f37a.tar.gz |
write frm pieces contiguously, don't align them on a 4K boundary
(in partition_archive.test frm size goes down 16 times :)
Diffstat (limited to 'sql/unireg.cc')
-rw-r--r-- | sql/unireg.cc | 24 |
1 files changed, 9 insertions, 15 deletions
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) |