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

fix DatabaseMetaData.getColumns() on old server version

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 3.1.2
    • metadata
    • 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

      Attachments

        Activity

          People

            diego dupin Diego Dupin
            diego dupin Diego Dupin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.