Uploaded image for project: 'DdlUtils'
  1. DdlUtils
  2. DDLUTILS-287

readModelFromDatabase() fails on MariaDB when schema being read is not the schema in the connection URL

    XMLWordPrintableJSON

Details

    • Patch

    Description

      MariaDB (and MySQL) JDBC connector requires a schema to be named as part of the JDBC URL. This results in that schema being the "default" schema for that connection, i.e. queries with unqualified table names are looked for in that schema.

      When Platform.readModelFromDatabase() is called for a schema OTHER THAN the schema named in the URL, MariaDB looks for the table under the other schema and doesn't find it, throwing an error like:

      org.apache.ddlutils.DatabaseOperationException: java.sql.SQLSyntaxErrorException: Table 'information_schema.column_stats' doesn't exist
      

      (column_stats is a table in the 'mysql' schema)

      Attachments

        Activity

          People

            tomdz Thomas Dudziak
            grlea Graham Lea
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: