CREATE TABLE `datesissue` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`dates` date DEFAULT NULL,
`user` varchar(64) COLLATE utf8mb3_bin NOT NULL,
`modified_user` varchar(64) COLLATE utf8mb3_bin NOT NULL,
`created_date` datetime NOT NULL DEFAULT current_timestamp(),
`modified_date` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`system_data_source` varchar(512) COLLATE utf8mb3_bin DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin
insert into datesissue (dates,user, modified_user) values(0.08,"abc","xyz")
update datesissue set dates = 0.00020596473883443116 where id = 1
字符串
我希望数据库抛出一个错误,
不正确的日期值:对于列datesissue
. dates
在第1行
1条答案
按热度按时间bjg7j2ky1#
MariaDB默认保留向后兼容性,这意味着接受无效日期。
如果您将SQL_MODE设置为包含NO_ZERO_DATE(以及NO_ZERO_IN_DATE),则会发生更符合预期的错误行为:
字符串