[
https://issues.apache.org/jira/browse/PHOENIX-1753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14374819#comment-14374819
]
Hudson commented on PHOENIX-1753:
---------------------------------
SUCCESS: Integrated in Phoenix-3.0-hadoop1 #378 (See
[https://builds.apache.org/job/Phoenix-3.0-hadoop1/378/])
PHOENIX-1753 Query with RVC that doesn't lead with the row key can return
incorrect results (jtaylor: rev decb89d3241349e9c11c516dc985a5430a6206ad)
* phoenix-core/src/main/java/org/apache/phoenix/compile/WhereOptimizer.java
* phoenix-core/src/test/java/org/apache/phoenix/compile/WhereOptimizerTest.java
* phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
> Query with RVC that doesn't lead with the row key can return incorrect results
> ------------------------------------------------------------------------------
>
> Key: PHOENIX-1753
> URL: https://issues.apache.org/jira/browse/PHOENIX-1753
> Project: Phoenix
> Issue Type: Bug
> Reporter: Samarth Jain
> Assignee: James Taylor
> Labels: 4.3.1
> Fix For: 5.0.0, 4.3.1, 4.4.0
>
> Attachments: PHOENIX-1753.patch
>
>
> Test case to reproduce the bug:
> {code}
> @Test
> public void testRVCWithRowKeyNotLeading() throws Exception {
> String ddl = "CREATE TABLE sorttest4 (rownum BIGINT primary key, name
> varchar(16), age integer)";
> Connection conn = nextConnection(getUrl());
> conn.createStatement().execute(ddl);
> conn.close();
> conn = nextConnection(getUrl());
> String dml = "UPSERT INTO sorttest4 (rownum, name, age) values (?, ?,
> ?)";
> PreparedStatement stmt = conn.prepareStatement(dml);
> stmt.setInt(1, 1);
> stmt.setString(2, "A");
> stmt.setInt(3, 1);
> stmt.executeUpdate();
> stmt.setInt(1, 2);
> stmt.setString(2, "B");
> stmt.setInt(3, 2);
> stmt.executeUpdate();
> conn.commit();
> conn.close();
> // the below query should only return one record -> (1, "A", 1)
> String query = "SELECT rownum, name, age FROM sorttest4 where (age,
> rownum) < (2, 2)";
> conn = nextConnection(getUrl());
> ResultSet rs = conn.createStatement().executeQuery(query);
> int numRecords = 0;
> while (rs.next()) {
> assertEquals(1, rs.getInt(1));
> assertEquals("A", rs.getString(2));
> assertEquals(1, rs.getInt(3));
> numRecords++;
> }
> assertEquals(1, numRecords);
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)