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

addition between time and interval is not compatible with Mysql #10325

Closed
erjiaqing opened this issue Apr 30, 2019 · 1 comment
Closed

addition between time and interval is not compatible with Mysql #10325

erjiaqing opened this issue Apr 30, 2019 · 1 comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug. type/compatibility

Comments

@erjiaqing
Copy link
Contributor

erjiaqing commented Apr 30, 2019

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
SELECT time('12:34:56') + INTERVAL 1 SECOND;
  1. What did you expect to see?
    In Mysql
mysql> select time('12:34:56') + interval 1 second;
+--------------------------------------+
| time('12:34:56') + interval 1 second |
+--------------------------------------+
| 12:34:57                             |
+--------------------------------------+
1 row in set (0.00 sec)
  1. What did you see instead?
    In TiDB
mysql> select time('12:34:56') + interval 1 second;
+--------------------------------------+
| time('12:34:56') + interval 1 second |
+--------------------------------------+
| 2019-04-30 12:34:57                  |
+--------------------------------------+
1 row in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    tidb_version(): Release Version: v3.0.0-beta-463-g36bb1ae89

In mysql's document:

time('12:34:56') + interval 1 second is same as date_add(time('12:34:56'), interval 1 second)

And

The date argument specifies the starting date or datetime value. expr is an expression specifying the interval value to be added or subtracted from the starting date.

@erjiaqing erjiaqing added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug. type/compatibility labels Apr 30, 2019
@erjiaqing
Copy link
Contributor Author

dup #9813

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/bug The issue is confirmed as a bug. type/compatibility
Projects
None yet
Development

No branches or pull requests

1 participant