Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
On older versions of MariaDB and MySQL, DatabaseMetaData.getColumns() will fail with the error Unknown column 'DATETIME_PRECISION' in 'field list'. This is due to the DATETIME_PRECISION column not being present in the INFORMATION_SCHEMA.COLUMNS table. This column was introduced as part of the introduction of microsecond precision in TIME/DATETIME/TIMESTAMP types, in MariaDB 5.3.0 and MySQL 5.6.4.
The proposed fix adjusts the metadata query for the relevant older server versions. The fixed behavior in these cases is as if the DATETIME_PRECISION field had a value of 0, which is consistent with the fact that these older database versions did not support any fractional seconds digits.
see https://github.com/mariadb-corporation/mariadb-connector-j/pull/182