[ 
https://issues.apache.org/jira/browse/DDLUTILS-287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14510904#comment-14510904
 ] 

Graham Lea commented on DDLUTILS-287:
-------------------------------------

I've made a fork which fixes this issue for MariaDB (at least) in this commit:

https://github.com/GrahamLea/ddlutils/commit/5e97f67b714d6c10ef9c705a65b6733e7f58d1e4

I've no facility for testing it against other DBMSs, though.

> 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
>              Labels: easyfix
>
> 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)

Reply via email to