[jira] [Created] (DDLUTILS-287) readModelFromDatabase() fails on MariaDB when schema being read is not the schema in the connection URL

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (DDLUTILS-287) readModelFromDatabase() fails on MariaDB when schema being read is not the schema in the connection URL

JIRA jira@apache.org
Graham Lea created DDLUTILS-287:
-----------------------------------

             Summary: readModelFromDatabase() fails on MariaDB when schema being read is not the schema in the connection URL
                 Key: DDLUTILS-287
                 URL: https://issues.apache.org/jira/browse/DDLUTILS-287
             Project: DdlUtils
          Issue Type: Bug
          Components: Core (No specific database), Core - MySql
    Affects Versions: 1.0
         Environment: MariaDB 10.0.17-MariaDB Homebrew
            Reporter: Graham Lea
            Assignee: Thomas Dudziak


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:
{code}
org.apache.ddlutils.DatabaseOperationException: java.sql.SQLSyntaxErrorException: Table 'information_schema.column_stats' doesn't exist
{code}
(column_stats is a table in the 'mysql' schema)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)