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-7277: JDBC: fixed duplicated table name in thin driver. This closes #3341.
Date Wed, 10 Jan 2018 12:55:07 GMT
Repository: ignite
Updated Branches:
  refs/heads/master 610720b43 -> 8e796dc5d


IGNITE-7277: JDBC: fixed duplicated table name in thin driver. This closes #3341.


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

Branch: refs/heads/master
Commit: 8e796dc5d69b7c1262f308292002867609196e4f
Parents: 610720b
Author: tledkov-gridgain <tledkov@gridgain.com>
Authored: Wed Jan 10 15:54:58 2018 +0300
Committer: devozerov <vozerov@gridgain.com>
Committed: Wed Jan 10 15:54:58 2018 +0300

----------------------------------------------------------------------
 .../jdbc/thin/JdbcThinMetadataSelfTest.java     |  8 ++++++++
 .../processors/odbc/jdbc/JdbcTableMeta.java     | 20 ++++++++++++++++++++
 2 files changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8e796dc5/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
index 16b0ad5..4a34be6 100644
--- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
+++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
@@ -200,24 +200,32 @@ public class JdbcThinMetadataSelfTest extends JdbcThinAbstractSelfTest
{
             assertEquals("TABLE", rs.getString("TABLE_TYPE"));
             assertEquals("PERSON", rs.getString("TABLE_NAME"));
 
+            assertFalse(rs.next());
+
             rs = meta.getTables("", "org", "%", new String[]{"TABLE"});
             assertNotNull(rs);
             assertTrue(rs.next());
             assertEquals("TABLE", rs.getString("TABLE_TYPE"));
             assertEquals("ORGANIZATION", rs.getString("TABLE_NAME"));
 
+            assertFalse(rs.next());
+
             rs = meta.getTables("", "pers", "%", null);
             assertNotNull(rs);
             assertTrue(rs.next());
             assertEquals("TABLE", rs.getString("TABLE_TYPE"));
             assertEquals("PERSON", rs.getString("TABLE_NAME"));
 
+            assertFalse(rs.next());
+
             rs = meta.getTables("", "org", "%", null);
             assertNotNull(rs);
             assertTrue(rs.next());
             assertEquals("TABLE", rs.getString("TABLE_TYPE"));
             assertEquals("ORGANIZATION", rs.getString("TABLE_NAME"));
 
+            assertFalse(rs.next());
+
             rs = meta.getTables("", "PUBLIC", "", new String[]{"WRONG"});
             assertFalse(rs.next());
         }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8e796dc5/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcTableMeta.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcTableMeta.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcTableMeta.java
index b954e97..5e15189 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcTableMeta.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/jdbc/JdbcTableMeta.java
@@ -17,9 +17,11 @@
 
 package org.apache.ignite.internal.processors.odbc.jdbc;
 
+import java.util.Objects;
 import org.apache.ignite.binary.BinaryObjectException;
 import org.apache.ignite.internal.binary.BinaryReaderExImpl;
 import org.apache.ignite.internal.binary.BinaryWriterExImpl;
+import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.S;
 
 /**
@@ -79,4 +81,22 @@ public class JdbcTableMeta implements JdbcRawBinarylizable {
     @Override public String toString() {
         return S.toString(JdbcTableMeta.class, this);
     }
+
+    /** {@inheritDoc} */
+    @Override public boolean equals(Object o) {
+        if (this == o)
+            return true;
+
+        if (o == null || getClass() != o.getClass())
+            return false;
+
+        JdbcTableMeta meta = (JdbcTableMeta)o;
+
+        return F.eq(schemaName, meta.schemaName) && F.eq(tblName, meta.tblName);
+    }
+
+    /** {@inheritDoc} */
+    @Override public int hashCode() {
+        return Objects.hash(schemaName, tblName);
+    }
 }


Mime
View raw message