mysql 5.1.43 開始,對timestamp 型別的分割槽有所改變

yantaicuiwei發表於2011-03-08
mysql 5.1.43 開始,對timestamp 型別的分割槽有所改變

The UNIX_TIMESTAMP() function is now supported in partitioning expressions using TIMESTAMPcolumns. For example, it now possible to create a partitioned table such as this one:

CREATE TABLE t (c TIMESTAMP) 
PARTITION BY RANGE ( UNIX_TIMESTAMP(c) ) (
    PARTITION p0 VALUES LESS THAN (631148400),
    PARTITION p1 VALUES LESS THAN (946681200),
    PARTITION p2 VALUES LESS THAN (MAXVALUE)
);

All other expressions involving TIMESTAMP values are now rejected with an error when attempting to create a new partitioned table or to alter an existing partitioned table.

When accessing an existing partitioned table having a timezone-dependent partitioning function (where the table was using a previous version of MySQL), a warning rather than an error is issued. In such cases, you should fix the table. One way of doing this is to alter the table's partitioning expression so that it uses UNIX_TIMESTAMP(). (Bug #42849)

在分割槽時不能再使用to_days 等函式,只能使用unix_timestamp()函式了

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21601207/viewspace-688754/,如需轉載,請註明出處,否則將追究法律責任。

相關文章