我收到错误: 错误代码:1064。不允许在(子)分区函数中使用常量,随机或与时区相关的表达式
是什么原因?以及如何摆脱这个错误?
CREATE TABLE TB_TEST_HIST(
TEST_ID INT AUTO_INCREMENT,
START_TIME DATETIME,
END_TIME DATETIME,
PRIMARY KEY(TEST_ID)
)ENGINE=INNODB PARTITION BY RANGE (START_TIME) (
PARTITION TEST_HIST_P0 VALUES LESS THAN
(ADDTIME(DATE_FORMAT(LAST_DAY(SYSDATE()) ,'%Y-%m-%d %00:00:00'), '1
0:0:0.000000')),
PARTITION TEST_HIST_P1 VALUES LESS THAN (
ADDTIME(DATE_FORMAT(LAST_DAY(SYSDATE()) ,'%Y-%m-%d %00:00:00'), '2
0:0:0.000000'))
);