Skip to content

Function DAY/DAYOFMONTH should do type conversation  #11178

@SunRunAway

Description

@SunRunAway

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.

  2. What did you expect to see?

mysql> SELECT DAY(120.000), DAYOFMONTH(0.000), DAYOFMONTH(0);
+--------------+-------------------+---------------+
| DAY(120.000) | DAYOFMONTH(0.000) | DAYOFMONTH(0) |
+--------------+-------------------+---------------+
|           20 |                 0 |             0 |
+--------------+-------------------+---------------+
1 row in set (0.00 sec)
  1. What did you see instead?
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 | invalid time format: '120.000'                         |
| Warning | 1292 | invalid time format: '0.000'                           |
| Warning | 1292 | Incorrect datetime value: '0000-00-00 00:00:00.000000' |
+---------+------+--------------------------------------------------------+
3 rows in set (0.00 sec)
  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    fdbc149

SIG slack channel

#sig-exec

Score

  • 300

Mentor

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions