MySQL Forums
Forum List  »  Partitioning

Re: Partitions didn`t work for me
Posted by: Igor Korsun
Date: November 22, 2007 05:13AM

!! Found some on http://dev.mysql.com/tech-resources/articles/mysql_5.1_partitioning_with_dates.html

CREATE TABLE part_date1
-> ( c1 int default NULL,
-> c2 varchar(30) default NULL,
-> c3 date default NULL) engine=myisam
-> partition by range (cast(date_format(c3,'%Y%m%d') as signed))
-> (PARTITION p0 VALUES LESS THAN (19950101),
-> PARTITION p1 VALUES LESS THAN (19960101) ,
-> PARTITION p2 VALUES LESS THAN (19970101) ,
-> PARTITION p3 VALUES LESS THAN (19980101) ,
-> PARTITION p4 VALUES LESS THAN (19990101) ,
-> PARTITION p5 VALUES LESS THAN (20000101) ,
-> PARTITION p6 VALUES LESS THAN (20010101) ,
-> PARTITION p7 VALUES LESS THAN (20020101) ,
-> PARTITION p8 VALUES LESS THAN (20030101) ,
-> PARTITION p9 VALUES LESS THAN (20040101) ,
-> PARTITION p10 VALUES LESS THAN (20100101),
-> PARTITION p11 VALUES LESS THAN MAXVALUE );
Query OK, 0 rows affected (0.01 sec)

Made similar:

ALTER TABLE tbl_result_1107296256_2
PARTITION BY RANGE (cast(date_format(StartTime,'%Y%m%d') as signed))
(
PARTITION p0 VALUES LESS THAN (20070701),
PARTITION p1 VALUES LESS THAN (20070801),
PARTITION p2 VALUES LESS THAN (20070901),
PARTITION p3 VALUES LESS THAN (20071001),
PARTITION p4 VALUES LESS THAN (20071101),
PARTITION p5 VALUES LESS THAN (20071201)
);

See the error: This partition function is not allowed 1561


where i`m wrong?

Options: ReplyQuote


Subject
Views
Written By
Posted
3898
November 22, 2007 04:52AM
Re: Partitions didn`t work for me
3144
November 22, 2007 05:13AM
2771
November 22, 2007 05:17AM
2760
November 22, 2007 05:51AM
2512
December 08, 2007 01:42AM


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.