Program: 112421
Project: 112421
Buggy source:
protected void helpTestSelectColOnlyInDataTable(boolean mutable,boolean localIndex) throws Exception {
  String dataTableName=generateUniqueName();
  String fullDataTableName=INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
  String indexName=generateUniqueName();
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  Connection conn=DriverManager.getConnection(getUrl(),props);
  try {
    conn.setAutoCommit(false);
    createDataTable(conn,fullDataTableName,mutable ? "String_Node_Str" : "String_Node_Str");
    populateDataTable(conn,fullDataTableName);
    String ddl="String_Node_Str" + (localIndex ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ indexName+ "String_Node_Str"+ fullDataTableName+ "String_Node_Str";
    conn=DriverManager.getConnection(getUrl(),props);
    conn.setAutoCommit(false);
    PreparedStatement stmt=conn.prepareStatement(ddl);
    stmt.execute();
    String sql="String_Node_Str" + fullDataTableName + "String_Node_Str";
    ResultSet rs=conn.createStatement().executeQuery("String_Node_Str" + sql);
    assertEquals("String_Node_Str" + (localIndex ? "String_Node_Str" + fullDataTableName + "String_Node_Str" : "String_Node_Str" + fullDataTableName + "String_Node_Str"),QueryUtil.getExplainPlan(rs));
    rs=conn.createStatement().executeQuery(sql);
    assertTrue(rs.next());
    assertEquals(2,rs.getInt(1));
    assertEquals(1,rs.getInt(2));
    assertFalse(rs.next());
    conn.createStatement().execute("String_Node_Str" + indexName + "String_Node_Str"+ fullDataTableName);
  }
  finally {
    conn.close();
  }
}

Fixed version (ground truth):
protected void helpTestSelectColOnlyInDataTable(boolean mutable,boolean localIndex) throws Exception {
  String dataTableName=generateUniqueName();
  String fullDataTableName=INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
  String indexName=generateUniqueName();
  Properties props=PropertiesUtil.deepCopy(TEST_PROPERTIES);
  Connection conn=DriverManager.getConnection(getUrl(),props);
  try {
    conn.setAutoCommit(false);
    createDataTable(conn,fullDataTableName,mutable ? "String_Node_Str" : "String_Node_Str");
    populateDataTable(conn,fullDataTableName);
    String ddl="String_Node_Str" + (localIndex ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ indexName+ "String_Node_Str"+ fullDataTableName+ "String_Node_Str";
    conn=DriverManager.getConnection(getUrl(),props);
    conn.setAutoCommit(false);
    conn.createStatement().execute(ddl);
    String sql="String_Node_Str" + fullDataTableName + "String_Node_Str";
    ResultSet rs=conn.createStatement().executeQuery("String_Node_Str" + sql);
    assertEquals("String_Node_Str" + (localIndex ? "String_Node_Str" + fullDataTableName + "String_Node_Str" : "String_Node_Str" + fullDataTableName + "String_Node_Str"),QueryUtil.getExplainPlan(rs));
    rs=conn.createStatement().executeQuery(sql);
    assertTrue(rs.next());
    assertEquals(2,rs.getInt(1));
    assertEquals(1,rs.getInt(2));
    assertFalse(rs.next());
    conn.createStatement().execute("String_Node_Str" + indexName + "String_Node_Str"+ fullDataTableName);
  }
  finally {
    conn.close();
  }
}