ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject ignite git commit: IGNITE-4643: Fixed NPE in JdbcDatabaseMetadata.getIndexInfo(). This closes #2481.
Date Wed, 23 Aug 2017 13:27:31 GMT
Repository: ignite
Updated Branches:
  refs/heads/master d22631e64 -> ac94426ce


IGNITE-4643: Fixed NPE in  JdbcDatabaseMetadata.getIndexInfo(). This closes #2481.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/ac94426c
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/ac94426c
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/ac94426c

Branch: refs/heads/master
Commit: ac94426ced2cee5df2c993029e2a17ea5a9aa398
Parents: d22631e
Author: Ilya Kasnacheev <ilya.kasnacheev@gmail.com>
Authored: Wed Aug 23 16:26:58 2017 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed Aug 23 16:26:58 2017 +0300

----------------------------------------------------------------------
 .../internal/jdbc2/JdbcMetadataSelfTest.java       | 17 +++++++++++++++++
 .../internal/jdbc2/JdbcDatabaseMetadata.java       |  2 ++
 2 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/ac94426c/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
index 52e68c9..f2ef769 100755
--- a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
@@ -278,6 +278,23 @@ public class JdbcMetadataSelfTest extends GridCommonAbstractTest {
     }
 
     /**
+     * @throws Exception If failed.
+     */
+    public void testIndexMetadata() throws Exception {
+        try (Connection conn = DriverManager.getConnection(BASE_URL);
+             ResultSet rs = conn.getMetaData().getIndexInfo(null, "pers", "PERSON", false,
false)) {
+
+            int cnt = 0;
+
+            while (rs.next()) {
+                cnt++;
+            }
+
+            assertEquals(0, cnt);
+        }
+    }
+
+    /**
      * Person.
      */
     @SuppressWarnings("UnusedDeclaration")

http://git-wip-us.apache.org/repos/asf/ignite/blob/ac94426c/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
index b369b0b..e9a5fde 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc2/JdbcDatabaseMetadata.java
@@ -965,6 +965,8 @@ public class JdbcDatabaseMetadata implements DatabaseMetaData {
     /** {@inheritDoc} */
     @Override public ResultSet getIndexInfo(String catalog, String schema, String tbl, boolean
unique,
         boolean approximate) throws SQLException {
+        updateMetaData();
+
         Collection<List<?>> rows = new ArrayList<>(indexes.size());
 
         for (List<Object> idx : indexes) {


Mime
View raw message