Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-699

Value range of TIME data type not fully supported

    XMLWordPrintable

    Details

      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:

      1. Create a table with a TIME column
      2. Insert values outside of the range '00:00:00' - '23:59:59'
      3. Try reading them using MariaDB Connector/J

        Attachments

          Activity

            People

            Assignee:
            diego dupin Diego Dupin
            Reporter:
            rag Renat Golubchyk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration