You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pat Patterson (JIRA)" <ji...@apache.org> on 2019/04/22 03:22:00 UTC

[jira] [Commented] (IGNITE-9730) JdbcThinDatabaseMetadata.getTables() is case-sensitive

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

Pat Patterson commented on IGNITE-9730:
---------------------------------------

Looks like a typo somewhere - I believe IGNITE-9730 above should be IGNITE-9720. Would be helpful to delete the above two bot-generated comments.

> JdbcThinDatabaseMetadata.getTables() is case-sensitive
> ------------------------------------------------------
>
>                 Key: IGNITE-9730
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9730
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.6
>            Reporter: Pat Patterson
>            Priority: Minor
>
> Create a table {{Tester}}, try to get its metadata via {{JdbcThinDatabaseMetadata.getTables()}}. No metadata is returned unless you use an uppercase table name.
> Issue seems to be that {{matches()}} in {{JdbcRequestHandler}} is case sensitive, unlike {{matches()}} in the client driver at {{JdbcDatabaseMetadata}}.
> Easily reproducible:
> {noformat}
> public static void testGetTables() throws ClassNotFoundException, SQLException {
>     // Register JDBC driver.
>     Class.forName("org.apache.ignite.IgniteJdbcThinDriver");
>     // Open JDBC connection.
>     try (Connection conn = DriverManager.getConnection("jdbc:ignite:thin://127.0.0.1/")) {
>       String tableName = "Tester";
>       // Create database table
>       try (Statement stmt = conn.createStatement()) {
>         stmt.executeUpdate("CREATE TABLE " + tableName + " (" +
>             " ID LONG PRIMARY KEY, NAME VARCHAR) " +
>             " WITH \"template=replicated\"");
>       }
>       // Get database metadata
>       DatabaseMetaData md = conn.getMetaData();
>       // Get table metadata
>       ResultSet rs = md.getTables(conn.getCatalog(), "", tableName, new String[]{"TABLE"});
>       System.out.println((rs.next() ? "Found metadata for " : "No metadata for ") + tableName);
>       // Try again with uppercase
>       tableName = tableName.toUpperCase();
>       rs = md.getTables(conn.getCatalog(), "", tableName, new String[]{"TABLE"});
>       System.out.println((rs.next() ? "Found metadata for " : "No metadata for ") + tableName);
>     }
>   }
> {noformat}
> Expected output:
> {noformat}
> Found metadata for Tester
> Found metadata for TESTER
> {noformat}
> Actual output:
> {noformat}
> No metadata for Tester
> Found metadata for TESTER
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)