Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1(EOL), 10.2(EOL), 10.3(EOL)
Description
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 (a DATETIME); |
INSERT INTO t1 VALUES (TIME'10:20:30'),(COALESCE(TIME'10:20:30')); |
SHOW WARNINGS;
|
SELECT * FROM t1; |
+---------+------+----------------------------------------+
|
| Level | Code | Message |
|
+---------+------+----------------------------------------+
|
| Warning | 1265 | Data truncated for column 'a' at row 2 |
|
+---------+------+----------------------------------------+
|
+---------------------+
|
| a |
|
+---------------------+
|
| 2016-11-22 10:20:30 |
|
| 0000-00-00 00:00:00 |
|
+---------------------+
|
This result is wrong. The expected result would be 2016-11-22 10:20:30 for both values.
The same problem is repeatable in this script:
SET timestamp=UNIX_TIMESTAMP('2001-02-03 10:20:30.123456'); |
CREATE OR REPLACE TABLE t1 (a DECIMAL(30,6) DEFAULT COALESCE(CURRENT_TIMESTAMP(6))); |
SHOW CREATE TABLE t1; |
INSERT INTO t1 VALUES (CURRENT_TIMESTAMP(6)); |
INSERT INTO t1 VALUES (COALESCE(CURRENT_TIMESTAMP(6))); |
INSERT INTO t1 VALUES(); |
SELECT * FROM t1; |
+-----------------------+
|
| a |
|
+-----------------------+
|
| 20010203102030.123456 |
|
| 2001.000000 |
|
| 2001.000000 |
|
+-----------------------+
|
The second and the third rows look wrong.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed
-
MDEV-11337 Split Item::save_in_field() into virtual methods in Type_handler
- Closed