Details
Description
The BIT field works well as a number in most cases,
but not when casting it to temporal data types:
DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a BIT(8)); INSERT INTO t1 VALUES (0xFF); SELECT a+0,CAST(255 AS TIME), CAST(a AS TIME) FROM t1; SHOW WARNINGS;
returns
+------+-------------------+-----------------+ | a+0 | CAST(255 AS TIME) | CAST(a AS TIME) | +------+-------------------+-----------------+ | 255 | 00:02:55 | 00:00:00 | +------+-------------------+-----------------+ 1 row in set, 1 warning (0.00 sec) +---------+------+----------------------------------------+ | Level | Code | Message | +---------+------+----------------------------------------+ | Warning | 1292 | Truncated incorrect time value: '\xFF' | +---------+------+----------------------------------------+
The expected result for CAST(a AS TIME) is '00:02:55'
without warnings.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
what versions are affected?