ITPub博客

首页 > Linux操作系统 > Linux操作系统 > mysql 5.1.43 开始,对timestamp 类型的分区有所改变

mysql 5.1.43 开始,对timestamp 类型的分区有所改变

原创 Linux操作系统 作者:yantaicuiwei 时间:2011-03-08 18:07:36 0 删除 编辑
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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-04-15

  • 博文量
    64
  • 访问量
    236731