We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
执行 CREATE TABLE seckill( seckill_id bigint NOT NULL AUTO_INCREMENT COMMENT '商品库存id', name varchar(120) NOT NULL COMMENT '商品名称', number int NOT NULL COMMENT '库存数量', start_time timestamp NOT NULL COMMENT '秒杀开启时间', end_time timestamp NOT NULL COMMENT '秒杀结束时间', create_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', PRIMARY KEY(seckill_id), key idx_start_time(start_time), key idx_end_time(end_time), key idx_create_time(create_time) )ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='秒杀库存表'; 出现 ERROR 1067 (42000): Invalid default value for 'end_time' 错误 很是疑惑
seckill_id
name
number
start_time
end_time
create_time
The text was updated successfully, but these errors were encountered:
由于使用的是mysql5.7,通过修改sql_mode已解决
Sorry, something went wrong.
No branches or pull requests
执行
CREATE TABLE seckill(
seckill_id
bigint NOT NULL AUTO_INCREMENT COMMENT '商品库存id',name
varchar(120) NOT NULL COMMENT '商品名称',number
int NOT NULL COMMENT '库存数量',start_time
timestamp NOT NULL COMMENT '秒杀开启时间',end_time
timestamp NOT NULL COMMENT '秒杀结束时间',create_time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',PRIMARY KEY(seckill_id),
key idx_start_time(start_time),
key idx_end_time(end_time),
key idx_create_time(create_time)
)ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8 COMMENT='秒杀库存表';
出现 ERROR 1067 (42000): Invalid default value for 'end_time' 错误
很是疑惑
The text was updated successfully, but these errors were encountered: