MySQL Forums
Forum List  »  Partitioning

partition by date then add partition does not work
Posted by: John Mizell
Date: January 16, 2009 11:05AM

First I alter my table with the following partitions:

alter table traninfo PARTITION BY RANGE (TO_DAYS(timestamp))
(
PARTITION January08 VALUES LESS THAN (to_days('2008-02-01')),
PARTITION February08 VALUES LESS THAN (to_days('2008-03-01')),
PARTITION March08 VALUES LESS THAN (to_days('2008-04-01')),
PARTITION April08 VALUES LESS THAN (to_days('2008-05-01')),
PARTITION May08 VALUES LESS THAN (to_days('2008-06-01')),
PARTITION June08 VALUES LESS THAN (to_days('2008-07-01')),
PARTITION July08 VALUES LESS THAN (to_days('2008-08-01')),
PARTITION August08 VALUES LESS THAN (to_days('2008-09-01')),
PARTITION September08 VALUES LESS THAN (to_days('2008-10-01')),
PARTITION October08 VALUES LESS THAN (to_days('2008-11-01')),
PARTITION November08 VALUES LESS THAN (to_days('2008-12-01')),
PARTITION December08 VALUES LESS THAN (to_days('2009-01-01')),
PARTITION January09 VALUES LESS THAN (to_days('2009-02-01'))
)
;

Which works just fine.

Then I want to add more partitions:
mysql> alter table traninfo add partition (February09 VALUES LESS THAN (to_days('2009-03-01')));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'February09 VALUES LESS THAN (to_days('2009-03-01')))' at line 1

I am under the understanding that you should be able to add partitions as long as they do not overlap. What am I doing wrong?

Mysql version 5.1.30 on centos 5.2.

Options: ReplyQuote


Subject
Views
Written By
Posted
partition by date then add partition does not work
3705
January 16, 2009 11:05AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.