WL 2826: Fourth step

Remove partition state from frm file
Ensure we can still load tables created in 5.1.6 for the time
being
parent e222f4d8
Branches unavailable
Tags unavailable
No related merge requests found
...@@ -638,38 +638,15 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, ...@@ -638,38 +638,15 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
#endif #endif
next_chunk+= 5 + partition_info_len; next_chunk+= 5 + partition_info_len;
} }
if (share->mysql_version > 50105 && next_chunk + 5 < buff_end) if (share->mysql_version == 50106)
{ {
/* /*
Partition state was introduced to support partition management in version 5.1.5 Partition state array was here in version 5.1.6, this code makes
*/ it possible to load a 5.1.6 table in later versions. Can most
uint32 part_state_len= uint4korr(next_chunk); likely be removed at some point in time.
#ifdef WITH_PARTITION_STORAGE_ENGINE */
if ((share->part_state_len= part_state_len)) next_chunk+= 4;
if (!(share->part_state=
(uchar*) memdup_root(&share->mem_root, next_chunk + 4,
part_state_len)))
{
my_free(buff, MYF(0));
goto err;
}
#else
if (part_state_len)
{
DBUG_PRINT("info", ("WITH_PARTITION_STORAGE_ENGINE is not defined"));
my_free(buff, MYF(0));
goto err;
}
#endif
next_chunk+= 4 + part_state_len;
} }
#ifdef WITH_PARTITION_STORAGE_ENGINE
else
{
share->part_state_len= 0;
share->part_state= NULL;
}
#endif
keyinfo= share->key_info; keyinfo= share->key_info;
for (i= 0; i < keys; i++, keyinfo++) for (i= 0; i < keys; i++, keyinfo++)
{ {
......
...@@ -136,7 +136,6 @@ bool mysql_create_frm(THD *thd, const char *file_name, ...@@ -136,7 +136,6 @@ bool mysql_create_frm(THD *thd, const char *file_name,
if (part_info) if (part_info)
{ {
create_info->extra_size+= part_info->part_info_len; create_info->extra_size+= part_info->part_info_len;
create_info->extra_size+= part_info->part_state_len;
} }
#endif #endif
...@@ -209,12 +208,6 @@ bool mysql_create_frm(THD *thd, const char *file_name, ...@@ -209,12 +208,6 @@ bool mysql_create_frm(THD *thd, const char *file_name,
my_write(file, (const byte*)part_info->part_info_string, my_write(file, (const byte*)part_info->part_info_string,
part_info->part_info_len + 1, MYF_RW)) part_info->part_info_len + 1, MYF_RW))
goto err; goto err;
DBUG_PRINT("info", ("Part state len = %d", part_info->part_state_len));
int4store(buff, part_info->part_state_len);
if (my_write(file, (const byte*)buff, 4, MYF_RW) ||
my_write(file, (const byte*)part_info->part_state,
part_info->part_state_len, MYF_RW))
goto err;
} }
else else
#endif #endif
......
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