Program: 112428
Project: 112428
Buggy source:
protected void helpTestIndexWithCaseSensitiveCols(boolean mutable,boolean localIndex) throws Exception {
  String dataTableName=generateUniqueName();
  String indexName=generateUniqueName();
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  Connection conn=DriverManager.getConnection(getUrl(),props);
  try {
    conn.createStatement().execute("String_Node_Str" + dataTableName + "String_Node_Str"+ (mutable ? "String_Node_Str" : "String_Node_Str"));
    String query="String_Node_Str" + dataTableName;
    ResultSet rs=conn.createStatement().executeQuery(query);
    assertFalse(rs.next());
    String ddl="String_Node_Str" + (localIndex ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ indexName+ "String_Node_Str"+ dataTableName+ "String_Node_Str";
    PreparedStatement stmt=conn.prepareStatement(ddl);
    stmt.execute();
    query="String_Node_Str" + indexName;
    rs=conn.createStatement().executeQuery(query);
    assertFalse(rs.next());
    stmt=conn.prepareStatement("String_Node_Str" + dataTableName + "String_Node_Str");
    stmt.setString(1,"String_Node_Str");
    stmt.setString(2,"String_Node_Str");
    stmt.setString(3,"String_Node_Str");
    stmt.execute();
    stmt.setString(1,"String_Node_Str");
    stmt.setString(2,"String_Node_Str");
    stmt.setString(3,"String_Node_Str");
    stmt.execute();
    conn.commit();
    query="String_Node_Str" + dataTableName + "String_Node_Str";
    rs=conn.createStatement().executeQuery("String_Node_Str" + query);
    if (localIndex) {
      assertEquals("String_Node_Str" + dataTableName + "String_Node_Str"+ "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
 else {
      assertEquals("String_Node_Str" + indexName + "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
    rs=conn.createStatement().executeQuery(query);
    assertTrue(rs.next());
    assertEquals("String_Node_Str",rs.getString(1));
    assertEquals("String_Node_Str",rs.getString(2));
    assertEquals("String_Node_Str",rs.getString(3));
    assertEquals("String_Node_Str",rs.getString(4));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertFalse(rs.next());
    query="String_Node_Str" + dataTableName + "String_Node_Str";
    rs=conn.createStatement().executeQuery("String_Node_Str" + query);
    if (localIndex) {
      assertEquals("String_Node_Str" + dataTableName + "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
 else {
      assertEquals("String_Node_Str" + indexName,QueryUtil.getExplainPlan(rs));
    }
    rs=conn.createStatement().executeQuery(query);
    assertTrue(rs.next());
    assertEquals("String_Node_Str",rs.getString(1));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(2));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(3));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(4));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(5));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertTrue(rs.next());
    assertEquals("String_Node_Str",rs.getString(1));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(2));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(3));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(4));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(5));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertFalse(rs.next());
    conn.createStatement().execute("String_Node_Str" + indexName + "String_Node_Str"+ dataTableName);
  }
  finally {
    conn.close();
  }
}

Fixed version (ground truth):
protected void helpTestIndexWithCaseSensitiveCols(boolean mutable,boolean localIndex) throws Exception {
  String dataTableName=generateUniqueName();
  String indexName=generateUniqueName();
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  Connection conn=DriverManager.getConnection(getUrl(),props);
  try {
    conn.createStatement().execute("String_Node_Str" + dataTableName + "String_Node_Str"+ (mutable ? "String_Node_Str" : "String_Node_Str"));
    String query="String_Node_Str" + dataTableName;
    ResultSet rs=conn.createStatement().executeQuery(query);
    assertFalse(rs.next());
    String ddl="String_Node_Str" + (localIndex ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ indexName+ "String_Node_Str"+ dataTableName+ "String_Node_Str";
    conn.createStatement().execute(ddl);
    query="String_Node_Str" + indexName;
    rs=conn.createStatement().executeQuery(query);
    assertFalse(rs.next());
    PreparedStatement stmt=conn.prepareStatement("String_Node_Str" + dataTableName + "String_Node_Str");
    stmt.setString(1,"String_Node_Str");
    stmt.setString(2,"String_Node_Str");
    stmt.setString(3,"String_Node_Str");
    stmt.execute();
    stmt.setString(1,"String_Node_Str");
    stmt.setString(2,"String_Node_Str");
    stmt.setString(3,"String_Node_Str");
    stmt.execute();
    conn.commit();
    query="String_Node_Str" + dataTableName + "String_Node_Str";
    rs=conn.createStatement().executeQuery("String_Node_Str" + query);
    if (localIndex) {
      assertEquals("String_Node_Str" + dataTableName + "String_Node_Str"+ "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
 else {
      assertEquals("String_Node_Str" + indexName + "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
    rs=conn.createStatement().executeQuery(query);
    assertTrue(rs.next());
    assertEquals("String_Node_Str",rs.getString(1));
    assertEquals("String_Node_Str",rs.getString(2));
    assertEquals("String_Node_Str",rs.getString(3));
    assertEquals("String_Node_Str",rs.getString(4));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertFalse(rs.next());
    query="String_Node_Str" + dataTableName + "String_Node_Str";
    rs=conn.createStatement().executeQuery("String_Node_Str" + query);
    if (localIndex) {
      assertEquals("String_Node_Str" + dataTableName + "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
 else {
      assertEquals("String_Node_Str" + indexName,QueryUtil.getExplainPlan(rs));
    }
    rs=conn.createStatement().executeQuery(query);
    assertTrue(rs.next());
    assertEquals("String_Node_Str",rs.getString(1));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(2));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(3));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(4));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(5));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertTrue(rs.next());
    assertEquals("String_Node_Str",rs.getString(1));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(2));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(3));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(4));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertEquals("String_Node_Str",rs.getString(5));
    assertEquals("String_Node_Str",rs.getString("String_Node_Str"));
    assertFalse(rs.next());
    conn.createStatement().execute("String_Node_Str" + indexName + "String_Node_Str"+ dataTableName);
  }
  finally {
    conn.close();
  }
}