Details
Description
CURRENT_TIME is limited to positive time in the range
from 00:00:00 to 23:59:59. So it should be enough 8 characters
to store it. However, it uses 10 characters in MariaDB-10.0.
For this script:
DROP TABLE IF EXISTS t1; CREATE TABLE t1 AS SELECT CONCAT(CURRENT_TIME()); SHOW COLUMNS FROM t1;
MariaDB 5.1 and 5.3 correctly returned length 8
(but wrong data type varbinary).
+------------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------------+--------------+------+-----+---------+-------+ | CONCAT(CURRENT_TIME()) | varbinary(8) | NO | | | | +------------------------+--------------+------+-----+---------+-------+
MariaDB 5.5 and 10.0 return wrong length (but correct data type varchar):
+------------------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------------+-------------+------+-----+---------+-------+ | CONCAT(CURRENT_TIME()) | varchar(10) | NO | | | | +------------------------+-------------+------+-----+---------+-------+
MySQL 5.5 and 5.6 return both type and length correctly:
MySQL-5.5 and MySQL-5.6 +------------------------+------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------------------+------------+------+-----+---------+-------+ | CONCAT(CURRENT_TIME()) | varchar(8) | NO | | | | +------------------------+------------+------+-----+---------+-------+
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Actually, 5.1 and 5.2 return varbinary(8); 5.3 returns varbinary(10); 5.5 and 10.0 returns varchar(10).