pingcap / pingcap/tidb

TiDB handles Incorrect datetime values differently from MySQL's behavior

Open
#41,532 1 comment 0 reactions 0 assignees View on GitHub
component/expression severity/minor sig/execution sig/planner type/bug type/compatibility
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Question

![fc4fd2e4-c5ef-489b-8ec9-32a7a663d095](https://user-images.githubusercontent.com/3297473/205478016-823b71d3-ee67-41e8-b40b-9706a051c030.jpeg)
用户版本6.11

TiDB 处理 Incorrect datetime 时,遇到程序传入错误的 datetime 时,是 warning,客户程序设置的只处理 error,不处理 warning。MySQL 5.7 处理这个问题时,不报错,没有 warning,能返回结果。MySQL 8.0 在遇到这个问题时,直接是 error。

另外麻烦确认:是不是咱们的兼容性有点问题,如果想暂时绕的话,jdbc 这边不论 statement 还是 preparedsatement 都可以通过 getwarning 获取警告,ibatis 估计也有类似的功能?

Now, please describe your question here:
[_Incorrect datetime MySQL TiDB.docx](https://github.com/pingcap/docs-cn/files/10148009/_Incorrect.datetime.MySQL.TiDB.docx)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.