pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
36.89k stars 5.81k forks source link

unexpected runtime warning error #54340

Open xhebox opened 2 months ago

xhebox commented 2 months ago

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE t (id INT, a VARBINARY(20), b BIGINT);
INSERT INTO t VALUES(1, _binary '2012-05-19 09:06:07', 20120519090607),
(1, _binary '2012-05-19 09:06:07', 20120519090607),
(2, _binary '12012-05-19 09:06:07', 120120519090607),
(2, _binary '12012-05-19 09:06:07', 120120519090607);
SELECT SUBTIME(BIT_OR(b), '1 1:1:1.000002') FROM t GROUP BY id;
show warnings;

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

+---------+------+---------------------------------------------------+
| Level   | Code | Message                                           |
+---------+------+---------------------------------------------------+
| Warning | 1292 | Truncated incorrect time value: '120120519090607' |
+---------+------+---------------------------------------------------+

3. What did you see instead (Required)

+---------+------+-----------------------------------------+
| Level   | Code | Message                                 |
+---------+------+-----------------------------------------+
| Warning | 1292 | Incorrect time value: '120120519090607' |
| Warning | 1105 |                                         |
+---------+------+-----------------------------------------+

4. What is your TiDB version? (Required)

xhebox commented 2 months ago

Ref #54043