Program: 112424
Project: 112424
Buggy source:
protected void helpTestGroupByCount(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";
    PreparedStatement stmt=conn.prepareStatement(ddl);
    stmt.execute();
    String groupBySql="String_Node_Str" + fullDataTableName + "String_Node_Str";
    ResultSet rs=conn.createStatement().executeQuery("String_Node_Str" + groupBySql);
    String expectedPlan="String_Node_Str" + (localIndex ? "String_Node_Str" + fullDataTableName + "String_Node_Str" : "String_Node_Str" + indexName) + "String_Node_Str"+ (localIndex ? "String_Node_Str" : "String_Node_Str");
    assertEquals(expectedPlan,QueryUtil.getExplainPlan(rs));
    rs=conn.createStatement().executeQuery(groupBySql);
    assertTrue(rs.next());
    assertEquals(1,rs.getInt(2));
    assertTrue(rs.next());
    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 helpTestGroupByCount(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.createStatement().execute(ddl);
    String groupBySql="String_Node_Str" + fullDataTableName + "String_Node_Str";
    ResultSet rs=conn.createStatement().executeQuery("String_Node_Str" + groupBySql);
    String expectedPlan="String_Node_Str" + (localIndex ? "String_Node_Str" + fullDataTableName + "String_Node_Str" : "String_Node_Str" + indexName) + "String_Node_Str"+ (localIndex ? "String_Node_Str" : "String_Node_Str");
    assertEquals(expectedPlan,QueryUtil.getExplainPlan(rs));
    rs=conn.createStatement().executeQuery(groupBySql);
    assertTrue(rs.next());
    assertEquals(1,rs.getInt(2));
    assertTrue(rs.next());
    assertEquals(1,rs.getInt(2));
    assertFalse(rs.next());
    conn.createStatement().execute("String_Node_Str" + indexName + "String_Node_Str"+ fullDataTableName);
  }
  finally {
    conn.close();
  }
}