You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Pat Patterson (JIRA)" <ji...@apache.org> on 2018/09/27 15:35:00 UTC

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

Pat Patterson created IGNITE-9730:
-------------------------------------

             Summary: 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


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)