You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@phoenix.apache.org by je...@apache.org on 2014/03/10 05:21:45 UTC
[14/36] git commit: Add test case (ignored) for PHOENIX-63 Can't add
null value to a secondary indexed table
Add test case (ignored) for PHOENIX-63 Can't add null value to a secondary 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/b44ad86a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/tree/b44ad86a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-phoenix/diff/b44ad86a
Branch: refs/heads/4.0
Commit: b44ad86aa88cd620fc19d9746eea6d0272b1345c
Parents: 3931fc9
Author: maryannxue <ma...@apache.org>
Authored: Thu Mar 6 15:36:57 2014 -0500
Committer: maryannxue <ma...@apache.org>
Committed: Thu Mar 6 15:36:57 2014 -0500
----------------------------------------------------------------------
.../phoenix/end2end/index/MutableIndexTest.java | 34 ++++++++++++++++++++
1 file changed, 34 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-phoenix/blob/b44ad86a/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 b8b0b2f..88d5c63 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
@@ -822,4 +822,38 @@ public class MutableIndexTest extends BaseMutableIndexTest {
conn.close();
}
}
+
+ @Ignore("PHOENIX-63")
+ @Test
+ public void testNullValueIndexKey() throws Exception {
+ Properties props = new Properties(TEST_PROPERTIES);
+ Connection conn = DriverManager.getConnection(getUrl(), props);
+ conn.setAutoCommit(false);
+ try {
+ String ddl = "CREATE TABLE DEMO(R VARCHAR PRIMARY KEY, A DOUBLE, C VARCHAR)";
+ conn.createStatement().execute(ddl);
+ ddl = "CREATE INDEX IDX_DEMO ON DEMO (A) INCLUDE (C)";
+ conn.createStatement().execute(ddl);
+
+ PreparedStatement stmt = conn.prepareStatement("upsert into DEMO values(?, ?, ?)");
+ stmt.setString(1, "r1");
+ stmt.setString(2, null);
+ stmt.setString(3, "c1");
+ stmt.executeUpdate();
+ conn.commit();
+
+ String query = "select * from DEMO";
+ ResultSet rs = conn.createStatement().executeQuery("EXPLAIN " + query);
+ assertEquals("CLIENT PARALLEL 1-WAY FULL SCAN OVER IDX_DEMO", QueryUtil.getExplainPlan(rs));
+
+ rs = conn.createStatement().executeQuery(query);
+ assertTrue(rs.next());
+ assertEquals("r1", rs.getString(1));
+ assertNull(rs.getString(2));
+ assertEquals("c1", rs.getString(3));
+ assertFalse(rs.next());
+ } finally {
+ conn.close();
+ }
+ }
}