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

Different results of time() #11866

Open
wjhuang2016 opened this issue Aug 26, 2019 · 8 comments
Open

Different results of time() #11866

wjhuang2016 opened this issue Aug 26, 2019 · 8 comments
Assignees
Labels
challenge-program component/expression 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. priority/P3 The issue has P3 priority. Assigned to backlog. severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug. type/compatibility

Comments

@wjhuang2016
Copy link
Member

wjhuang2016 commented Aug 26, 2019

Description

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("10:11:1212");
select time("-1? 10:11:12");
  • Need to refine ParseDuration in types/time.go
  1. What did you expect to see?
mysql> select time("10:11:1212");
+--------------------+
| time("10:11:1212") |
+--------------------+
| NULL               |
+--------------------+
1 row in set, 1 warning (0.00 sec)

mysql> select time("-1? 10:11:12");
+----------------------+
| time("-1? 10:11:12") |
+----------------------+
| -00:00:01            |
+----------------------+
1 row in set, 1 warning (0.00 sec)

Note: according to https://dev.mysql.com/doc/refman/5.7/en/time.html
The first result should be 00:00:00 insteal of NULL
3. What did you see instead?

mysql> select time("10:11:1212");
+--------------------+
| time("10:11:1212") |
+--------------------+
| 10:11:12           |
+--------------------+
1 row in set (0.00 sec)

mysql> select time("-1? 10:11:12");
+----------------------+
| time("-1? 10:11:12") |
+----------------------+
| -10:11:12            |
+----------------------+
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)?
mysql> select tidb_version();
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                                  |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v4.0.0-alpha-119-ge8597cd03
Git Commit Hash: e8597cd0398e9ef3fc71803271270c179cd1fb7d
Git Branch: fix_time
UTC Build Time: 2019-08-26 05:04:46
GoVersion: go version go1.12.4 linux/amd64
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

SIG slack channel

#sig-exec

Score

  • 300

Mentor

@wjhuang2016 wjhuang2016 added type/bug The issue is confirmed as a bug. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/compatibility good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. component/expression labels Aug 26, 2019
@edytagarbarz
Copy link
Contributor

I am working on it

@qw4990
Copy link
Contributor

qw4990 commented Aug 26, 2020

This problem still exists on Master:

mysql> select time("10:11:1212");
+--------------------+
| time("10:11:1212") |
+--------------------+
| 00:00:00           |
+--------------------+
1 row in set, 1 warning (0.00 sec)

mysql> select time("-1? 10:11:12");
+----------------------+
| time("-1? 10:11:12") |
+----------------------+
| 00:00:00             |
+----------------------+
1 row in set, 1 warning (0.00 sec)

@qw4990 qw4990 added the priority/P3 The issue has P3 priority. Assigned to backlog. label Aug 27, 2020
@scsldb scsldb added this to the v4.0.12 milestone Oct 29, 2020
@dragonly
Copy link
Contributor

dragonly commented Nov 3, 2020

/assign

@dragonly
Copy link
Contributor

dragonly commented Nov 3, 2020

/pick-up

@ti-challenge-bot
Copy link

Pick up success.

@scsldb scsldb modified the milestones: v4.0.12, v4.0.9 Nov 4, 2020
@ichn-hu
Copy link
Contributor

ichn-hu commented Nov 10, 2020

Hi @dragonly do you have any updates on this?

@ti-challenge-bot
Copy link

@dragonly You did not submit PR within 7 days, so give up automatically.

@ti-challenge-bot ti-challenge-bot bot removed the picked label Nov 10, 2020
@ichn-hu
Copy link
Contributor

ichn-hu commented Nov 10, 2020

/assign @dragonly

@zz-jason zz-jason removed this from the v4.0.9 milestone Nov 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenge-program component/expression 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. priority/P3 The issue has P3 priority. Assigned to backlog. severity/moderate sig/execution SIG execution type/bug The issue is confirmed as a bug. type/compatibility
Projects
None yet
Development

No branches or pull requests

10 participants