Bug #20130 | ALTER TABLE ... ADD PARTITION needs a force option | ||
---|---|---|---|
Submitted: | 29 May 2006 19:06 | Modified: | 2 Nov 2007 16:06 |
Reporter: | Jeremy Cole (Basic Quality Contributor) (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Partitions | Severity: | S4 (Feature request) |
Version: | 5.1.9 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[29 May 2006 19:06]
Jeremy Cole
[29 May 2006 19:07]
Jeremy Cole
Changing Category to Partitioning.
[29 May 2006 20:58]
Valeriy Kravchuk
Thank you for a problem report. Sorry, but this is a documented behaviour, not a bug. Please, read the manual (http://dev.mysql.com/doc/refman/5.1/en/partitioning-management-range-list.html): "Important: With tables that are partitioned by range, you can use ADD PARTITION to add new partitions to the high end of the partitions list only. Trying to add a new partition in this manner between or before existing partitions will result in an error as shown here: mysql> ALTER TABLE members > ADD PARTITION ( > PARTITION p3 VALUES LESS THAN (1960)); ERROR 1463 (HY000): VALUES LESS THAN value must be strictly increasing for each partition" Although, there should be some way to get rid of partition's data without problems like this. So, I'll mark this report as a verified feature request.
[16 Jun 2006 12:49]
Valeriy Kravchuk
Looks like there is a way to do what you want already: ALTER TABLE t REORGANIZE PARTITION p_2 INTO (PARTITION p_1 VALUES LESS THEN (2), PARTITION p_2 VALUES LESS THEN (3));
[2 Nov 2007 16:06]
Mattias Jonsson
Closing this since it is possible to do ALTER TABLE t REORGANIZE PARTITION instead.