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

Incorrect padding for row key columns

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.1.0, 4.1.0
    • None
    • None

    Description

      @Test 
          public void testInListOfRVC6() throws Exception {
              String tenantId = "ABC";
              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', 'hel1', 1, 1)");
              conn.createStatement().executeUpdate("upsert into t (tenantId, pk2, pk3, c1) values ('ABC', 'hel2', 2, 2)");
              conn.createStatement().executeUpdate("upsert into t (tenantId, pk2, pk3, c1) values ('ABC', 'hel3', 3, 3)");
              conn.createStatement().executeUpdate("upsert into t (tenantId, pk2, pk3, c1) values ('ABC', 'hel4', 4, 4)");
              conn.createStatement().executeUpdate("upsert into t (tenantId, pk2, pk3, c1) values ('ABC', 'hel5', 5, 5)");
              conn.commit();
              conn.close();
      
              conn = nextConnection(getUrl());
              //order by needed on the query to make the order of rows returned deterministic.
              PreparedStatement stmt = conn.prepareStatement("select pk2, pk3 from t WHERE (tenantId, pk2, pk3) IN ((?, ?, ?), (?, ?, ?))");
              stmt.setString(1, tenantId);
              stmt.setString(2, "hel3");
              stmt.setInt(3, 3);
              stmt.setString(4, tenantId);
              stmt.setString(5, "hel5");
              stmt.setInt(6, 5);
      
              ResultSet rs = stmt.executeQuery();
              assertTrue(rs.next());
              assertEquals("hel3", rs.getString(1));
              assertEquals(3, rs.getInt(2));
              assertTrue(rs.next());
              assertEquals("hel5", rs.getString(1));
              assertEquals(5, rs.getInt(2));
              conn.close();
          }
      

      Attachments

        1. PHOENIX-1140_3.0.patch
          16 kB
          Samarth Jain
        2. PHOENIX-1140_v2.patch
          81 kB
          James R. Taylor

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: