-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
The subtime() function returns an incorrect result when using the date
type
#56861
Comments
/severity major |
Looks like in https://github.com/pingcap/tidb/blob/3c8f2f3517a4529b5162df69724df389a506aea3/pkg/expression/builtin_time.go#L4581-l4582 |
date
type
/severity moderate |
/remove-severity major |
/assign |
…ction when using the date type (pingcap#57337) close pingcap#56861
/label fuzz/comp |
/label affects-7.5 |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
Mysql:
+------------+---------------------------------+
| col1 | subtime(col1,'12:00:01.341300') |
+------------+---------------------------------+
| 2024-11-01 | 2024-10-31 11:59:58.658700 |
| 2020-11-01 | 2020-10-31 11:59:58.658700 |
+------------+---------------------------------+
3. What did you see instead (Required)
+------------+---------------------------------+
| col1 | subtime(col1,'12:00:01.341300') |
+------------+---------------------------------+
| 2024-11-01 | -12:00:01.341300 |
| 2020-11-01 | -12:00:01.341300 |
+------------+---------------------------------+
4. What is your TiDB version? (Required)
Release Version: v8.4.0
Edition: Community
Git Commit Hash: 2511e92
Git Branch: HEAD
UTC Build Time: 2024-10-27 16:16:04
GoVersion: go1.23.2
Race Enabled: false
Check Table Before Drop: false
Store: tikv
The text was updated successfully, but these errors were encountered: