I'm trying to make a partitioned table with the following RANGE function
CREATE TABLE `fact_events` (
`event_key` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`event_type_key` tinyint(3) unsigned NOT NULL,
`analytic_file_id` bigint(20) unsigned NOT NULL ',
`sdk_session_id` bigint(20) unsigned NOT NULL,
`virtual_button_create_id` bigint(20) unsigned NOT NULL C,
PRIMARY KEY (`event_key`),
KEY `idx_events_event_type` (`event_type_key`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY RANGE(FLOOR(event_key/100000))
PARTITION p0 VALUES LESS THAN (0),
PARTITION p1 VALUES LESS THAN (1),
PARTITION p2 VALUES LESS THAN (2),
PARTITION p3 VALUES LESS THAN (3),
PARTITION p4 VALUES LESS THAN (4),
PARTITION p513 VALUES LESS THAN MAXVALUE
)
I keep getting
ERROR 1564 (HY000): This partition function is not allowed
Any ideas would be welcome thanks