Program: 112426
Project: 112426
Buggy source:
protected void helpTestCaseSensitiveFunctionIndex(boolean mutable,boolean localIndex) throws Exception {
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  Connection conn=DriverManager.getConnection(getUrl(),props);
  String dataTableName=generateUniqueName();
  String indexName=generateUniqueName();
  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.execute();
    stmt.setString(1,"String_Node_Str");
    stmt.setString(2,"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"+ "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
    rs=conn.createStatement().executeQuery(query);
    assertTrue(rs.next());
    assertEquals("String_Node_Str",rs.getString(1));
    assertFalse(rs.next());
  }
  finally {
    conn.close();
  }
}

Fixed version (ground truth):
protected void helpTestCaseSensitiveFunctionIndex(boolean mutable,boolean localIndex) throws Exception {
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  Connection conn=DriverManager.getConnection(getUrl(),props);
  String dataTableName=generateUniqueName();
  String indexName=generateUniqueName();
  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.execute();
    stmt.setString(1,"String_Node_Str");
    stmt.setString(2,"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"+ "String_Node_Str",QueryUtil.getExplainPlan(rs));
    }
    rs=conn.createStatement().executeQuery(query);
    assertTrue(rs.next());
    assertEquals("String_Node_Str",rs.getString(1));
    assertFalse(rs.next());
  }
  finally {
    conn.close();
  }
}