You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by mu...@apache.org on 2014/02/05 21:38:46 UTC

git commit: Test to repro ArrayIndexOutOfBoundsException on query with in clause on indexed table

Updated Branches:
  refs/heads/master 974ad584b -> c2a7b2341


Test to repro ArrayIndexOutOfBoundsException on query with in clause on indexed table


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

Branch: refs/heads/master
Commit: c2a7b2341fb4bc6249f23066ca707e17d0956623
Parents: 974ad58
Author: Mujtaba <mu...@apache.org>
Authored: Wed Feb 5 12:35:53 2014 -0800
Committer: Mujtaba <mu...@apache.org>
Committed: Wed Feb 5 12:35:53 2014 -0800

----------------------------------------------------------------------
 .../phoenix/end2end/index/MutableIndexTest.java  | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/c2a7b234/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java b/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
index cc09ead..bfab13a 100644
--- a/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
+++ b/phoenix-core/src/test/java/org/apache/phoenix/end2end/index/MutableIndexTest.java
@@ -751,4 +751,23 @@ public class MutableIndexTest extends BaseMutableIndexTest {
             conn.close();
         }
     }
+
+    @Test
+    public void testInFilterOnIndexedTable() throws Exception {
+        Properties props = new Properties(TEST_PROPERTIES);
+        Connection conn = DriverManager.getConnection(getUrl(), props);
+        conn.setAutoCommit(false);
+        try {
+	        String ddl = "CREATE TABLE TEST (PK1 CHAR(2) NOT NULL PRIMARY KEY, CF1.COL1 BIGINT)";
+	        conn.createStatement().execute(ddl);
+	        ddl = "CREATE INDEX IDX1 ON TEST (COL1)";
+	        conn.createStatement().execute(ddl);
+	
+	        String query = "SELECT COUNT(COL1) FROM TEST WHERE COL1 IN (1,25,50,75,100)"; 
+	        ResultSet rs = conn.createStatement().executeQuery(query);
+	        assertTrue(rs.next());
+        } finally {
+            conn.close();
+        }
+    }
 }