Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Not a Bug
-
None
-
None
Description
MariaDB Connector/J uses java.sql.Time for TIME columns. TIME columns have a range of '-838:59:59.999999' to '838:59:59.999999'. According to Java documentation "java.sql.Time is a thin wrapper around java.util.Date":
- An hour is represented by an integer from 0 to 23. Thus, the hour from midnight to 1 a.m. is hour 0, and the hour from noon to 1 p.m. is hour 12.
- A minute is represented by an integer from 0 to 59 in the usual manner.
- A second is represented by an integer from 0 to 61; the values 60 and 61 occur only for leap seconds and even then only in Java implementations that actually track leap seconds correctly. Because of the manner in which leap seconds are currently introduced, it is extremely unlikely that two leap seconds will occur in the same minute, but this specification follows the date and time conventions for ISO C.
That means Connector/J supports only a tiny subset of possible values.
How to reproduce:
- Create a table with a TIME column
- Insert values outside of the range '00:00:00' - '23:59:59'
- Try reading them using MariaDB Connector/J