Depending on the input, TIME() is able to infer the required precision.
Currently, we always assume max precision (6)
mysql> select time('12:34:56.123456');
Field 1: `time('12:34:56.123456')`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: TIME
Collation: binary (63)
Length: 17
Max_length: 15
Decimals: 6
Flags: BINARY
+-------------------------+
| time('12:34:56.123456') |
+-------------------------+
| 12:34:56.123456 |
+-------------------------+
1 row in set (0.00 sec)
mysql> select time('12:34:56.1234');
Field 1: `time('12:34:56.1234')`
Catalog: `def`
Database: ``
Table: ``
Org_table: ``
Type: TIME
Collation: binary (63)
Length: 15
Max_length: 13
Decimals: 4
Flags: BINARY
+-----------------------+
| time('12:34:56.1234') |
+-----------------------+
| 12:34:56.1234 |
+-----------------------+
1 row in set (0.00 sec)
Depending on the input,
TIME()is able to infer the required precision.Currently, we always assume max precision (6)