-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken DatabaseMetaData.getColumns() on older server versions.
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 (I believe) and MySQL 5.6.4. The proposed fix adjusts the metadata query for the relevant older server versions. The behavior 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. Similar conditional logic already exist in the MySQL project's JDBC driver.
- Loading branch information
1 parent
8ae1292
commit 38615eb
Showing
1 changed file
with
55 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters