Bug #52422 | Cannot do ALTER TABLE DISCARD TABLESPACE if table has partitions | ||
---|---|---|---|
Submitted: | 29 Mar 2010 3:41 | Modified: | 14 Mar 2014 9:41 |
Reporter: | Philip Tellis | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S3 (Non-critical) |
Version: | 5.1.41, 5.1, 5.6.99 bzr | OS: | Linux (RHEL4/5) |
Assigned to: | Mattias Jonsson | CPU Architecture: | Any |
Tags: | innodb, partition, Tablespace |
[29 Mar 2010 3:41]
Philip Tellis
[29 Mar 2010 5:08]
Sveta Smirnova
Thank you for the report. Verified as described. innodb_file_per_table is not required to repeat the problem.
[29 Mar 2010 20:19]
Philip Tellis
typo in my description. The second partition should be p1 and not p0.
[25 Aug 2010 13:01]
Mattias Jonsson
needs to implement ha_partition::discard_or_import_tablespace().
[14 Sep 2010 18:26]
Konstantin Osipov
We find the syntax to discard and import an individual tablespace to be not appropriate for a set of .ibd files associated with a partitioned table, and the risk of a user mistake to provide a different file when importing a tablespace too high to allow for such functionality. It's a valid feature request, however, to make it work, but we will not consider doing it in any upcoming version. Instead, we plan to extend the backup solutions that MySQL provides to be able to backup and restore an individual table. Thank you for your interest in MySQL.
[25 Feb 2011 14:40]
MySQL Verification Team
http://bugs.mysql.com/bug.php?id=60251 marked as duplicate of this one.
[28 Feb 2012 14:19]
Andrew Hefford
We have had this problem (with 5.1.41) a couple of times now following crashes during daily repartitions and occasionally when in the final stages a #table.par file is left behind the partition that was in the process of being dropped is left behind. Deleting these files the leaves error messages in the logs each time the server is restarted, with no way to resolve them. We are left with no practical way to resolve this issue. 120228 13:53:53 InnoDB: Error: trying to open a table, but could not InnoDB: open the tablespace file './database/table#parXX.ibd'! InnoDB: Have you moved InnoDB .ibd files around without using the InnoDB: commands DISCARD TABLESPACE and IMPORT TABLESPACE? InnoDB: It is also possible that this is a temporary table #sql..., InnoDB: and MySQL removed the .ibd file for this. InnoDB: Please refer to InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting-datadict.html InnoDB: for how to resolve the issue.
[13 Feb 2013 15:48]
Mattias Jonsson
In 5.6 one can use EXCHANGE PARTITION: http://dev.mysql.com/doc/refman/5.6/en/partitioning-management-exchange.html to be able to export a single partition. It also makes it possible to IMPORT a .ibd file as a table, and then EXCHANGE it to a partition.
[30 Aug 2013 9:08]
Valeriy Kravchuk
EXCHANGE will not help to restore access to the table if one of .ibd files for partition is missing. See http://bugs.mysql.com/bug.php?id=70196 also.
[14 Mar 2014 9:41]
Mattias Jonsson
Fixed in 5.7.4, see http://dev.mysql.com/doc/refman/5.7/en/tablespace-copying.html