summaryrefslogtreecommitdiff
path: root/sql/unireg.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-04-09 15:56:52 +0200
committerSergei Golubchik <sergii@pisem.net>2013-04-09 15:56:52 +0200
commitcb5473cb2f0cea5eeace0fec17e0840fcba8f37a (patch)
tree874def786aaa29dbc3fadd3fb1f3a21ea61d26dd /sql/unireg.cc
parente671cba9ede179a8c631e572450198dbad17aaa0 (diff)
downloadmariadb-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.cc24
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)