gpt4 book ai didi

MySQL 接受不正确的日期类型数据

转载 作者:行者123 更新时间:2023-11-29 03:24:06 24 4
gpt4 key购买 nike

CREATE TABLE datetime_datatype1 (
datedata DATE,
timedata TIME,
datetimedata DATETIME,
timestampdata TIMESTAMP,
yeardata YEAR
);

INSERT INTO datetime_datatype1
VALUES
(
'0010-8-22',
'22:00:00',
'10-11-28 22:02:00',
'1970-12-30 11:00:40',
'2155'
);

datedata 列正在接受日期值 '0010-8-22',没有任何错误。

实际 MySQL 日期范围是 1000-01-01 到 9999-12-31

最佳答案

来自same link发布者 Shiv_k (并在 answer 中错误地标记为错误):

(...) this is not a bug.

(...)

The manual is correct as written.

It says, "The *supported* range is...". While you *may* be able to use dates earlier than the supported lower limit, there is no guarantee.

关于MySQL 接受不正确的日期类型数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39076503/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com