ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pat Patterson (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-9730) JdbcThinDatabaseMetadata.getTables() is case-sensitive
Date Thu, 27 Sep 2018 15:35:00 GMT
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)

Mime
View raw message