Skip to content

Commit

Permalink
cleanup: extra_rec_buf_length
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Dec 12, 2016
1 parent 98be2d8 commit 605cf61
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 28 deletions.
12 changes: 0 additions & 12 deletions sql/ha_partition.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8440,18 +8440,6 @@ uint ha_partition::max_supported_keys() const
}


uint ha_partition::extra_rec_buf_length() const
{
handler **file;
uint max= (*m_file)->extra_rec_buf_length();

for (file= m_file, file++; *file; file++)
if (max < (*file)->extra_rec_buf_length())
max= (*file)->extra_rec_buf_length();
return max;
}


uint ha_partition::min_record_length(uint options) const
{
handler **file;
Expand Down
6 changes: 0 additions & 6 deletions sql/ha_partition.h
Original file line number Diff line number Diff line change
Expand Up @@ -1009,12 +1009,6 @@ class ha_partition :public handler
virtual uint max_supported_key_parts() const;
virtual uint max_supported_key_length() const;
virtual uint max_supported_key_part_length() const;

/*
The extra record buffer length is the maximum needed by all handlers.
The minimum record length is the maximum of all involved handlers.
*/
virtual uint extra_rec_buf_length() const;
virtual uint min_record_length(uint options) const;

/*
Expand Down
1 change: 0 additions & 1 deletion sql/handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,6 @@ class handler :public Sql_alloc
virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; }
bool has_transactions()
{ return (ha_table_flags() & HA_NO_TRANSACTIONS) == 0; }
virtual uint extra_rec_buf_length() const { return 0; }

/**
This method is used to analyse the error to see whether the error
Expand Down
12 changes: 5 additions & 7 deletions sql/table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ static void mysql57_calculate_null_position(TABLE_SHARE *share,
if ((strpos[10] & MYSQL57_GENERATED_FIELD))
{
/* Skip virtual (not stored) generated field */
bool stored_in_db= (bool) (uint) (vcol_screen_pos[3]);
bool stored_in_db= vcol_screen_pos[3];
vcol_screen_pos+= (uint2korr(vcol_screen_pos + 1) +
MYSQL57_GCOL_HEADER_SIZE);
if (! stored_in_db)
Expand Down Expand Up @@ -982,7 +982,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
uint interval_count, interval_parts, read_length, int_length;
uint db_create_options, keys, key_parts, n_length;
uint com_length, null_bit_pos, mysql57_vcol_null_bit_pos, bitmap_count;
uint extra_rec_buf_length;
uint i;
bool use_hash, mysql57_null_bits= 0;
char *keynames, *names, *comment_pos;
Expand Down Expand Up @@ -1400,8 +1399,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
if (share->db_plugin && !plugin_equals(share->db_plugin, se_plugin))
goto err; // wrong engine (someone changed the frm under our feet?)

extra_rec_buf_length= uint2korr(frm_image+59);
rec_buff_length= ALIGN_SIZE(share->reclength + 1 + extra_rec_buf_length);
rec_buff_length= ALIGN_SIZE(share->reclength + 1);
share->rec_buff_length= rec_buff_length;
if (!(record= (uchar *) alloc_root(&share->mem_root,
rec_buff_length)))
Expand Down Expand Up @@ -1638,7 +1636,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
vcol_info= new (&share->mem_root) Virtual_column_info();
vcol_info_length= uint2korr(vcol_screen_pos + 1);
DBUG_ASSERT(vcol_info_length);
vcol_info->stored_in_db= (bool) (uint) vcol_screen_pos[3];
vcol_info->stored_in_db= vcol_screen_pos[3];
if (!(vcol_info->expr_str.str=
(char *)memdup_root(&share->mem_root,
vcol_screen_pos + MYSQL57_GCOL_HEADER_SIZE,
Expand Down Expand Up @@ -1673,7 +1671,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
else if ((uint)vcol_screen_pos[0] != 1)
goto err;

vcol_info->stored_in_db= (bool) (uint) vcol_screen_pos[2];
vcol_info->stored_in_db= vcol_screen_pos[2];
vcol_expr_length= vcol_info_length -
(uint)(FRM_VCOL_OLD_HEADER_SIZE(opt_interval_id));
if (!(vcol_info->expr_str.str=
Expand Down Expand Up @@ -3731,7 +3729,7 @@ void prepare_frm_header(THD *thd, uint reclength, uchar *fileinfo,
int4store(fileinfo+51, tmp);
int4store(fileinfo+55, create_info->extra_size);
/*
59-60 is reserved for extra_rec_buf_length,
59-60 is unused since 10.2.4
61 for default_part_db_type
*/
int2store(fileinfo+62, create_info->key_block_size);
Expand Down
2 changes: 0 additions & 2 deletions sql/unireg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,6 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
DBUG_PRINT("info", ("part_db_type = %d", fileinfo[61]));
}

int2store(fileinfo+59,db_file->extra_rec_buf_length());

memcpy(frm_ptr, fileinfo, FRM_HEADER_SIZE);

pos+= key_buff_length;
Expand Down

0 comments on commit 605cf61

Please sign in to comment.