Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1398

RVC combined with OR on a row key column that is not the first column in row key doesn't return all rows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 4.2.0
    • None
    • None
    • None

    Description

      
      

      @Test
      public void testRVCExpressionWithOr2() throws Exception

      { String tableDDL = "CREATE TABLE t (tenantId char(15) NOT NULL, pk2 char(15) NOT NULL, pk3 INTEGER NOT NULL, c1 INTEGER constraint pk primary key (tenantId,pk2,pk3))"; createTestTable(getUrl(), tableDDL, null, nextTimestamp()); Connection conn = nextConnection(getUrl()); conn.createStatement().executeUpdate("upsert into t (tenantId, pk2, pk3, c1) values ('ABC', 'helo1', 1, 1)"); conn.createStatement().executeUpdate("upsert into t (tenantId, pk2, pk3, c1) values ('ABC', 'helo2', 2, 2)"); conn.createStatement().executeUpdate("upsert into t (tenantId, pk2, pk3, c1) values ('ABC', 'helo3', 3, 3)"); conn.commit(); conn.close(); conn = nextConnection(getUrl()); PreparedStatement stmt = conn.prepareStatement("select pk2, pk3 from t WHERE pk2 = ? OR pk2 = ? AND (tenantId, pk2, pk3) > (?, ?, ?) LIMIT 100"); stmt.setString(1, "helo2"); stmt.setString(2, "helo3"); // give back all rows after row 1 - ABC|helo1|1 stmt.setString(3, "ABC"); stmt.setString(4, "helo1"); stmt.setInt(5, 1); ResultSet rs = stmt.executeQuery(); assertTrue(rs.next()); assertEquals("helo2", rs.getString(1)); assertEquals(2, rs.getInt(2)); assertTrue(rs.next()); assertEquals("helo3", rs.getString(1)); assertEquals(3, rs.getInt(2)); }

      java.lang.AssertionError
      at org.junit.Assert.fail(Assert.java:86)
      at org.junit.Assert.assertTrue(Assert.java:41)
      at org.junit.Assert.assertTrue(Assert.java:52)
      at org.apache.phoenix.end2end.RowValueConstructorIT.testRVCExpressionWithOr(RowValueConstructorIT.java:1310)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              samarthjain Samarth Jain
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: