Skip to content

EXTRACT is not compatible with MySQL for truncated value #59421

@YangKeao

Description

@YangKeao

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

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

mysql> SELECT EXTRACT(DAY_HOUR FROM 0x0D0E0A);
+---------------------------------+
| EXTRACT(DAY_HOUR FROM 0x0D0E0A) |
+---------------------------------+
|                            NULL |
+---------------------------------+
1 row in set, 2 warnings (0.02 sec)

mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                 |
+---------+------+-------------------------------------------------------------------------------------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '\x0D\x0E\x0A'                                                                          |
| Warning | 4096 | Delimiter '\r' in position 0 in datetime value '\x0D\x0E\x0A' at row 1 is superfluous and is deprecated. Please remove. |
+---------+------+-------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)

3. What did you see instead (Required)

mysql> SELECT EXTRACT(DAY_HOUR FROM 0x0D0E0A);
ERROR 1292 (22007): Truncated incorrect time value: 

4. What is your TiDB version? (Required)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions