MySQL partitioning by range - error in statement? -


i try alter existing table adding partitioning, sql errors although looks docu says.

hopefully can point out mistake.

the table orders has field called date_order_start, date, has no time information. field has index on it. index not unique , not part of unique index.

i want partition table using statement:

alter table orders partition range (date_order_start) (     startpoint   values less (0),     from20140701 values less ('2014-07-01'),     from20140801 values less ('2014-08-01'),     from20140901 values less ('2014-09-01'),     future       values less maxvalue ); 

error....

before tried this:

alter table orders partition range (to_days(date_order_start)) (     startpoint   values less (0),     from20140701 values less (to_days('2014-07-01')),     from20140801 values less (to_days('2014-08-01')),     from20140901 values less (to_days('2014-09-01')),     future       values less maxvalue ); 

but got error:

**error code: 1064**. have error in sql syntax; check manual corresponds mysql server version right syntax use near 'from20140701 values less ('2014-07-01'), from20140801 values less t' @ line 4 

well.... not help.

can spot error?

also variation without startpoint statement didn't work. thought maybe (0) problem.

i used these pages information:

http://dev.mysql.com/tech-resources/articles/mysql_55_partitioning.html http://dev.mysql.com/doc/refman/5.5/en/alter-table-partition-operations.html

i'm wondering if you're missing partition keyword:

alter table orders partition range (date_order_start) ( partition startpoint values less (0), partition from20140701 values less ('2014-07-01'), partition from20140801 values less ('2014-08-01'), partition from20140901 values less ('2014-09-01'), partition future values less maxvalue );

also, values less (0) part necessary?


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

order - Notification for user in user account opencart -