Commit c31c4eec authored by unknown's avatar unknown
Browse files

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


sql/table.cc:
  Remove partition state from frm file
  Ensure we can still load tables created in 5.1.6 for the time
  being
sql/unireg.cc:
  Remove partition state from frm file
  Ensure we can still load tables created in 5.1.6 for the time
  being
parent 83d418a2
Loading
Loading
Loading
Loading
+6 −29
Original line number Diff line number Diff line
@@ -638,38 +638,15 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
#endif
      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
         likely be removed at some point in time.
       */
      uint32 part_state_len= uint4korr(next_chunk);
#ifdef WITH_PARTITION_STORAGE_ENGINE
      if ((share->part_state_len= part_state_len))
        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;
      next_chunk+= 4;
    }
#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;
    for (i= 0; i < keys; i++, keyinfo++)
    {
+0 −7
Original line number Diff line number Diff line
@@ -136,7 +136,6 @@ bool mysql_create_frm(THD *thd, const char *file_name,
  if (part_info)
  {
    create_info->extra_size+= part_info->part_info_len;
    create_info->extra_size+= part_info->part_state_len;
  }
#endif

@@ -209,12 +208,6 @@ bool mysql_create_frm(THD *thd, const char *file_name,
        my_write(file, (const byte*)part_info->part_info_string,
                 part_info->part_info_len + 1, MYF_RW))
      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
#endif