Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL)
-
None
Description
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 AS SELECT |
CAST(TIME'10:10:10.123456' AS SIGNED) AS c1, |
CAST(TIME'10:10:10.123456' AS UNSIGNED) AS c2; |
DESC t1; |
+-------+---------------------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+-------+---------------------+------+-----+---------+-------+
|
| c1 | bigint(17) | NO | | NULL | |
|
| c2 | bigint(20) unsigned | NO | | NULL | |
|
+-------+---------------------+------+-----+---------+-------+
|
Looks excessive. TIME can have only 7 digits in the integer part: hhhmmss.
Attachments
Issue Links
- relates to
-
MDEV-4912 Data type plugin API version 1
- Closed
-
MDEV-13232 Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&share->intern_lock)->m_mutex)->thread)' failed in _ma_state_info_write
- Closed
A similar problem is repeatable when casting from signed int to signed int:
+-------+------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------------+------+-----+---------+-------+
| c1 | bigint(11) | YES | | NULL | |
| c2 | int(11) | YES | | NULL | |
+-------+------------+------+-----+---------+-------+
Notice, the data type for the column c1 was erroneously detected as bigint(11). We're casting from SIGNED INT to SIGNED INT, so nothing should change. The expected data type should be int, not bigint. Notice, COALESCE() does preserve int.