Details
-
Bug
-
Status: Closed (View Workflow)
-
Trivial
-
Resolution: Won't Fix
-
5.5.25
-
None
-
None
Description
I presume it affects 5.3 too, but I didn't check. In any case, I am not sure it's worth changing, since no harm is done, but it differs from the doc (https://kb.askmonty.org/en/microseconds-in-mariadb/) which says that the precision is an INTEGER number, so I thought it makes sense to check.
Normally the syntax for microseconds precision doesn't allow anything but digits, but it makes an exception for a decimal points. A precision value with a fractional part is truncated.
create table t1 (f time(5.8));
|
# Query OK, 0 rows affected (0.14 sec)
|
|
|
show create table t1;
|
# +-------+---------------------------------------------------------------------------------------+
|
# | Table | Create Table |
|
# +-------+---------------------------------------------------------------------------------------+
|
# | t1 | CREATE TABLE `t1` (
|
# `f` time(5) DEFAULT NULL
|
# ) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
# +-------+---------------------------------------------------------------------------------------+
|
|
|
select cast('12:12:12.12' as time(0.5));
|
# +----------------------------------+
|
# | cast('12:12:12.12' as time(0.5)) |
|
# +----------------------------------+
|
# | 12:12:12 |
|
# +----------------------------------+
|