Skip to content
New issue

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

another DATETIME's behaviour is different from mysql #19853

Closed
9547 opened this issue Sep 8, 2020 · 6 comments · Fixed by #20418
Closed

another DATETIME's behaviour is different from mysql #19853

9547 opened this issue Sep 8, 2020 · 6 comments · Fixed by #20418
Labels
challenge-program severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.

Comments

@9547
Copy link
Contributor

9547 commented Sep 8, 2020

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

similar to #11329

1. Minimal reproduce step (Required)

select date_add('2001-01-00', interval -2 hour);

2. What did you expect to see? (Required)

in MySQL 8.0:

mysql root@127.0.0.1:app> select date_add('2001-01-00', interval -2 hour);
+------------------------------------------+
| date_add('2001-01-00', interval -2 hour) |
+------------------------------------------+
| <null>                                   |
+------------------------------------------+
1 row in set
Time: 0.021s
mysql root@127.0.0.1:app> show warnings;
+---------+------+----------------------------------------+
| Level   | Code | Message                                |
+---------+------+----------------------------------------+
| Warning | 1292 | Incorrect datetime value: '2001-01-00' |
+---------+------+----------------------------------------+

3. What did you see instead (Required)

in TiDB

mysql root@127.0.0.1:(none)> select date_add('2001-00-01', interval -2 hour);
+------------------------------------------+
| date_add('2001-00-01', interval -2 hour) |
+------------------------------------------+
| 2000-11-30 22:00:00                      |
+------------------------------------------+

4. What is your TiDB version? (Required)

mysql root@127.0.0.1:(none)> select tidb_version() \G;
***************************[ 1. row ]***************************
tidb_version() | Release Version: v4.0.0-beta.2-1165-g726341146-dirty
Edition: Community
Git Commit Hash: 726341146b99485335a195b16a803b95e4875228
Git Branch: master
UTC Build Time: 2020-09-08 01:55:13
GoVersion: go1.14.3
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

1 row in set
Time: 0.009s

SIG slack channel

#sig-exec

Score

  • 300

Mentor

@9547 9547 added the type/bug The issue is confirmed as a bug. label Sep 8, 2020
@wshwsh12
Copy link
Contributor

wshwsh12 commented Sep 8, 2020

/label sig/execution

@ti-srebot ti-srebot added the sig/execution SIG execution label Sep 8, 2020
@9547
Copy link
Contributor Author

9547 commented Sep 8, 2020

@wshwsh12 Seems it's related to the server mode of NO_ZERO_IN_DATE and found another incompatible issue of NO_ZERO_DATE see detail from #19892

@xiaodong-ji
Copy link
Contributor

/pick-up

@ti-challenge-bot
Copy link

Pick up success.

@ichn-hu
Copy link
Contributor

ichn-hu commented Nov 12, 2020

@xiaodong-ji Hi, do you have any updates on this?

@xiaodong-ji
Copy link
Contributor

@xiaodong-ji Hi, do you have any updates on this?

The PR is waiting to be reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge-program severity/major sig/execution SIG execution type/bug The issue is confirmed as a bug.
Projects
None yet
6 participants