-
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
Function DAY/DAYOFMONTH should do type conversation #11178
Comments
Perhaps it's a common issue for all date and time functions. In MySQL, mysql> SELECT TO_SECONDS('0.112') ; show warnings;
+---------------------+
| TO_SECONDS('0.112') |
+---------------------+
| 63140342400 |
+---------------------+
1 row in set (0.00 sec)
Empty set (0.00 sec) In TiDB, mysql> SELECT TO_SECONDS('0.112') ; show warnings;
+---------------------+
| TO_SECONDS('0.112') |
+---------------------+
| NULL |
+---------------------+
1 row in set, 1 warning (0.00 sec)
+---------+------+------------------------------+
| Level | Code | Message |
+---------+------+------------------------------+
| Warning | 1292 | invalid time format: '0.112' |
+---------+------+------------------------------+
1 row in set (0.00 sec) |
Confirming I can still reproduce this against master: SELECT DAY(120.000), DAYOFMONTH(0.000), DAYOFMONTH(0);
SHOW WARNINGS;
SELECT TO_SECONDS('0.112') ;
SHOW WARNINGS;
..
mysql> SELECT DAY(120.000), DAYOFMONTH(0.000), DAYOFMONTH(0);
+--------------+-------------------+---------------+
| DAY(120.000) | DAYOFMONTH(0.000) | DAYOFMONTH(0) |
+--------------+-------------------+---------------+
| NULL | NULL | NULL |
+--------------+-------------------+---------------+
1 row in set, 3 warnings (0.00 sec)
mysql> SHOW WARNINGS;
+---------+------+-------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------+
| Warning | 1292 | Incorrect time value: '120.000' |
| Warning | 1292 | Incorrect datetime value: '0000-00-00 00:00:00' |
| Warning | 1292 | Incorrect datetime value: '0000-00-00 00:00:00' |
+---------+------+-------------------------------------------------+
3 rows in set (0.00 sec)
mysql> SELECT TO_SECONDS('0.112') ;
+---------------------+
| TO_SECONDS('0.112') |
+---------------------+
| NULL |
+---------------------+
1 row in set, 1 warning (0.00 sec)
mysql> SHOW WARNINGS;
+---------+------+-------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------+
| Warning | 1292 | Incorrect time value: '0.112' |
+---------+------+-------------------------------+
1 row in set (0.00 sec)
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.0-beta.2-750-g8a661044c
Edition: Community
Git Commit Hash: 8a661044cedf8daad1de4fbf79a390962b6f6c3b
Git Branch: master
UTC Build Time: 2020-07-10 10:52:37
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec) |
Hi @SunRunAway , can I work on this issue as the HP TiDB challenge? |
/pick-up |
It is not a pickable issue! MoreTip : If you want this issue to be picked, you need to add a Warning: None |
/pick-up |
Pick up success. |
@Patrick0308 You did not submit PR within 7 days, so give up automatically. |
/pick-up |
Pick up success. |
@Patrick0308 You did not submit PR within 7 days, so give up automatically. |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
What did you do?
If possible, provide a recipe for reproducing the error.
What did you expect to see?
tidb-server -V
or runselect tidb_version();
on TiDB)?fdbc149
SIG slack channel
#sig-exec
Score
Mentor
The text was updated successfully, but these errors were encountered: