Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
5.5.25, 5.3.7
-
None
-
None
Description
When a value with microseconds is truncated while being inserted into a time column, it does not cause a warning, as it happens in the similar situation with other data types:
Microseconds truncated, no warning:
CREATE TABLE t (c1 TIME(3));
|
INSERT INTO t VALUES ('10:11:12.12345');
|
SELECT * FROM t;
|
c1
|
10:11:12.123
|
Fractional part of a decimal value truncated, a warning is produced:
CREATE TABLE t (d DECIMAL(5,3));
|
INSERT INTO t VALUES (12.34567);
|
Warnings:
|
Note 1265 Data truncated for column 'd' at row 1
|
SELECT * FROM t;
|
d
|
12.346
|
It might cause a confusion, especially if a user does not expect that the server knows about microseconds and takes them into account:
CREATE TABLE t (c1 TIME);
|
INSERT INTO t VALUES ('10:11:12.123');
|
SELECT * FROM t WHERE c1 = '10:11:12.123';
|
c1
|
DROP TABLE t;
|
The empty result set is understandable considering that TIME is actually TIME(0), and that the inserted value is silently truncated, while in the select the string literal is converted into a temporal value with microseconds; but it is not obvious at all without a warning about truncation.
Attachments
Issue Links
- relates to
-
MDEV-369 Mismatches in MySQL engines test suite
- Closed