Bug #51279 Constant, random or timezone-dependent expressions in (sub)p
Submitted: 18 Feb 2010 10:33 Modified: 18 Feb 2010 10:58
Reporter: Chaya Shindhe Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Partitions Severity:S1 (Critical)
Version: 5.1.43 OS:Linux
Assigned to: CPU Architecture:Any

[18 Feb 2010 10:33] Chaya Shindhe
Description:
Hi,

  I'm trying to create a partition table 
       CREATE TABLE TEST
       (
        ID INT NOT NULL AUTO_INCREMENT,
        SETG_DATE TIMESTAMP NOT NULL DEFAULT now(),
        PRIMARY KEY (ID,SETG_DATE)
       )
       ENGINE=INNODB
        PARTITION  BY RANGE (TO_DAYS(SETG_DATE))
        (
        PARTITION MONTH_NULL VALUES LESS THAN (0),
        PARTITION JAN  VALUES LESS THAN (TO_DAYS('2010-01-01')),
        PARTITION FEB VALUES LESS THAN (TO_DAYS('2010-03-01')),
        PARTITION MARCH VALUES LESS THAN (TO_DAYS('2010-04-01')),
        PARTITION APRIL VALUES LESS THAN (TO_DAYS('2010-05-01')),
        PARTITION MAY VALUES LESS THAN (TO_DAYS('2010-06-01')),
        PARTITION JUNE VALUES LESS THAN (TO_DAYS('2010-07-01')),
        PARTITION JULY VALUES LESS THAN (TO_DAYS('2010-08-01')),
        PARTITION AUG  VALUES LESS THAN (TO_DAYS('2010-09-01')),
        PARTITION SEP VALUES LESS THAN (TO_DAYS('2010-10-01')),
        PARTITION OCT VALUES LESS THAN (TO_DAYS('2010-11-01')),
        PARTITION NOV VALUES LESS THAN MAXVALUE
        );

I'm able to create this partitioned table in "Server version: 5.1.41-log MySQL Community Server (GPL)" 

But its throwing the error "ERROR 1486 (HY000): Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed" when im trying to do it in "Server version: 5.1.43 MySQL Community Server (GPL)"                              

Can you please provide me the solution as soon as possible?

How to repeat:
To Repeat, Just execute the Create table statement.
[18 Feb 2010 10:58] Valeriy Kravchuk
This is a documented change in behavior in 5.1.43. Read http://dev.mysql.com/doc/refman/5.1/en/partitioning-range.html (at the bottom).