[teiid-issues] [JBoss JIRA] Updated: (TEIID-522) JDBC DatabaseMetadata methods do not accept empty string as catalog name

Steven Hawkins (JIRA) jira-events at lists.jboss.org
Tue Apr 21 14:33:22 EDT 2009


     [ https://jira.jboss.org/jira/browse/TEIID-522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steven Hawkins updated TEIID-522:
---------------------------------

        Fix Version/s: 6.1.0
    Affects Version/s: 6.0.0
           Complexity: Low


> JDBC DatabaseMetadata methods do not accept empty string as catalog name 
> -------------------------------------------------------------------------
>
>                 Key: TEIID-522
>                 URL: https://jira.jboss.org/jira/browse/TEIID-522
>             Project: Teiid
>          Issue Type: Bug
>          Components: JDBC Driver
>    Affects Versions: 6.0.0
>         Environment: http://anonsvn.jboss.org/repos/teiid/trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/MMDatabaseMetaData.java rev 809
>            Reporter: Greg Haber
>            Assignee: Steven Hawkins
>             Fix For: 6.1.0
>
>
> This is related to internal support ticket I-T #212065 (which was against MetaMatrix 5.5SP2).
> To resolve that ticket (where a third party software package expected different behavior from the MetaMatrix JDBC driver than it actually had), we made three changes:
> 1) DatabaseMetaData.supportsSchemaInDataManipulation() was changed to return true (which is correct) - looks like this change was also brought over to Teiid
> 2) DatabaseMetaData.supportsCatalogInDataManipulation() was changed to return the value of the boolean driver property "supportsCatalog".  This change didn't come over to Teiid (in Teiid this method always returns "false").  I'm fine with the current Teiid behavior, since we don't have a notion of catalog, so really "false" is the correct response here.
> 3)  The DatabaseMetaData methods getColumns, getExportedKeys, getImportedKeys, getIndexInfo, getPrimaryKeys, getProcedureColumns, getProcedures, and getTables all have a parameter for catalog name.  In the current Teiid implementation of MMDatabaseMetaData, if catalog is non-null an empty response is returned.  
> This is actually incorrect behavior according to both 1.5 and 1.6 javadoc - see http://java.sun.com/javase/6/docs/api/java/sql/DatabaseMetaData.html#getTables(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String[]) where it says:
> catalog - a catalog name; must match the catalog name as it is stored in the database; "" retrieves those without a catalog; null means that the catalog name should not be used to narrow the search
> So, since Teiid does not have the notion of a catalog, it should accept either null or the empty string as valid values for the catalog parameter.
> In the MMx 5.5.x code base, all of these methods were changed to only return empty responses if catalog was non-null, and also was not the empty string:
> if ((catalog != null) && (catalog.length() > 0)) {
> This same change should be made to Teiid.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the teiid-issues mailing list