Bug #15521 Cannot reorganize a partition with a new name equal to the old name
Submitted: 6 Dec 2005 15:43 Modified: 20 Dec 2005 13:54
Reporter: Kolbe Kegel Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.1.3 OS:Linux (Linux)
Assigned to: Alexey Botchkov CPU Architecture:Any

[6 Dec 2005 15:43] Kolbe Kegel
Description:
It is not possible to reorganize a partition with a new name equal to the old name

How to repeat:
create table t1 (a int) partition by range (a) (partition p0 values less than (10), partition p1 values less than (20), partition p2 values less than maxvalue);

alter table t1 reorganise partition p2 into (partition p2 values less than (30));
-- ERROR 1492 (HY000): All partitions must have unique names in the table

Suggested fix:
It should be possible to reorganize a partition in such a way that the new partition has the same name as [one of] the old partition[s]. This would be analogous to changing a column definition using ALTER TABLE (i.e. ALTER TABLE t1 CHANGE c1 c1 INT).

REORGANIZE PARTITION should create a new partition with a temporary name, and then delete the old partition and rename the new one upon success.
[12 Dec 2005 19:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/78
[15 Dec 2005 10:52] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/172
[16 Dec 2005 7:56] Alexey Botchkov
fixed in 5.1.4
[20 Dec 2005 13:54] Jon Stephens
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Documented in 5.1.4 changelog; added note to 5.1 Partitioning chapter in Manual. Closed.