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

Function adddate() returns unexpected when connect with jdbc driver #36394

Closed
Damon-Guo opened this issue Jul 21, 2022 · 3 comments · Fixed by #28133
Closed

Function adddate() returns unexpected when connect with jdbc driver #36394

Damon-Guo opened this issue Jul 21, 2022 · 3 comments · Fixed by #28133
Assignees
Labels
affects-5.3 This bug affects 5.3.x versions. severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@Damon-Guo
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

select adddate('2022-07-21',interval 1 day) from dual;

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

mysql> select adddate('2022-07-21',interval 1 day) from dual;
+--------------------------------------+
| adddate('2022-07-21',interval 1 day) |
+--------------------------------------+
| 2022-07-22 |
+--------------------------------------+
1 row in set (0.00 sec)

3. What did you see instead (Required)

return null when use jdbc driver 8.0.29
image

return ’2022-07-22 00:00:00.0‘ when use jdbc driver 5.1.49
image

4. What is your TiDB version? (Required)

mysql> select version();
+--------------------+
| version() |
+--------------------+
| 5.7.25-TiDB-v5.3.2 |
+--------------------+
1 row in set (0.00 sec)

@Damon-Guo Damon-Guo added the type/bug The issue is confirmed as a bug. label Jul 21, 2022
@tangenta
Copy link
Contributor

@Damon-Guo Is it convenient for you to put the MySQL's result here?

@Damon-Guo
Copy link
Author

@Damon-Guo Is it convenient for you to put the MySQL's result here?

origin_img_v2_57e0e9b0-62c2-4215-8831-90e0dabddb1g

origin_img_v2_b831ec5e-320d-4e44-a388-722147f9d8eg

@tangenta
Copy link
Contributor

This issue has been fixed by #28133. It takes effect in v5.4.0 or higher version TiDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-5.3 This bug affects 5.3.x versions. severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants