[
https://issues.apache.org/jira/browse/METAMODEL-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14358292#comment-14358292
]
Kasper Sørensen commented on METAMODEL-117:
-------------------------------------------
Sounds like you almost have a patch ready? :)
> JdbcDataContext.getDefaultSchemaName sometimes give wrong result
> ----------------------------------------------------------------
>
> Key: METAMODEL-117
> URL: https://issues.apache.org/jira/browse/METAMODEL-117
> Project: Apache MetaModel
> Issue Type: Bug
> Environment: Windows 7 connecting to MySQL
> Reporter: Philip Welch
> Priority: Minor
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> I'm using metamodel to connect to mysql. I have several databases - including
> once called test (created by default) and once called testmetamodel.
> JdbcDataContext.getDefaultSchemaName loops over all schema (i.e. databases)
> names accessible via the jdbc connection and takes the first schema which it
> can find within the last token of the URL connection (using string.indexof).
> The URL connection is jdbc:mysql://localhost/testmetamodel and the last token
> is testmetamodel. As I have a database called 'test' and 'test' is a
> substring of 'testmetamodel' it incorrectly returns 'test' from
> getDefaultSchemaName().
> Instead of returning the first schema whose name is a substring of the last
> token in the URL, it should return the schema with the longest name and whose
> name is also a substring of the last token in the URL.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)