Commit f6108b1f authored by Sergei Golubchik's avatar Sergei Golubchik

comments

parent b10937ea
...@@ -45,22 +45,19 @@ static bool pack_fields(uchar *, List<Create_field> &, ulong); ...@@ -45,22 +45,19 @@ static bool pack_fields(uchar *, List<Create_field> &, ulong);
static size_t packed_fields_length(List<Create_field> &); static size_t packed_fields_length(List<Create_field> &);
static bool make_empty_rec(THD *, uchar *, uint, List<Create_field> &, uint, ulong); static bool make_empty_rec(THD *, uchar *, uint, List<Create_field> &, uint, ulong);
/* /**
Create a frm (table definition) file Create a frm (table definition) file
SYNOPSIS @param thd Thread handler
build_frm_image() @param table Name of table
thd Thread handler @param create_info create info parameters
table Name of table @param create_fields Fields to create
create_info create info parameters @param keys number of keys to create
create_fields Fields to create @param key_info Keys to create
keys number of keys to create @param db_file Handler to use.
key_info Keys to create
db_file Handler to use.
RETURN @return the generated frm image as a LEX_CUSTRING,
false ok or null LEX_CUSTRING (str==0) in case of an error.
true error
*/ */
LEX_CUSTRING build_frm_image(THD *thd, const char *table, LEX_CUSTRING build_frm_image(THD *thd, const char *table,
...@@ -200,16 +197,16 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table, ...@@ -200,16 +197,16 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
key_buff_length= uint4korr(fileinfo+47); key_buff_length= uint4korr(fileinfo+47);
frm.length= FRM_HEADER_SIZE; // fileinfo; frm.length= FRM_HEADER_SIZE; // fileinfo;
frm.length+= 7; // "form entry" frm.length+= uint2korr(fileinfo+4) + 4; // "form entry"
int2store(fileinfo+6, frm.length); int2store(fileinfo+6, frm.length);
frm.length+= key_buff_length; frm.length+= key_buff_length;
frm.length+= reclength; // row with default values frm.length+= reclength; // row with default values
frm.length+= create_info->extra_size; frm.length+= create_info->extra_size;
filepos= frm.length; filepos= frm.length;
frm.length+= FRM_FORMINFO_SIZE; // forminfo frm.length+= FRM_FORMINFO_SIZE; // forminfo
frm.length+= packed_fields_length(create_fields); frm.length+= packed_fields_length(create_fields);
frm_ptr= (uchar*) my_malloc(frm.length, MYF(MY_WME | MY_ZEROFILL | frm_ptr= (uchar*) my_malloc(frm.length, MYF(MY_WME | MY_ZEROFILL |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment