Program: 95957
Project: 95957
Buggy source:
@Test public void test5Tpch() throws VerdictDBException, SQLException {
  RelationStandardizer.resetItemID();
  String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  stmt.execute("String_Node_Str");
  SelectQueryCoordinator coordinator=new SelectQueryCoordinator(new JdbcConnection(conn,new MysqlSyntax()));
  coordinator.setScrambleMetaSet(meta);
  coordinator.setDefaultSchema("String_Node_Str");
  ExecutionResultReader reader=coordinator.process(sql);
  NonValidatingSQLParser sqlToRelation=new NonValidatingSQLParser();
  AbstractRelation relation=sqlToRelation.toRelation(sql);
  RelationStandardizer gen=new RelationStandardizer(coordinator.getStaticMetaData());
  relation=gen.standardize((SelectQuery)relation);
  SelectQueryToSql selectQueryToSql=new SelectQueryToSql(new MysqlSyntax());
  String stdQuery=selectQueryToSql.toSql(relation);
  int cnt=0;
  while (reader.hasNext()) {
    DbmsQueryResult dbmsQueryResult=reader.next();
    cnt++;
    if (cnt == 12) {
      ResultSet rs=stmt.executeQuery(stdQuery);
      while (rs.next()) {
        dbmsQueryResult.next();
        assertEquals(rs.getString(1),dbmsQueryResult.getString(0));
        assertEquals(rs.getDouble(2),dbmsQueryResult.getDouble(1),1e-5);
      }
    }
  }
  assertEquals(12,cnt);
  stmt.execute("String_Node_Str");
}

Fixed version (ground truth):
@Test public void test5Tpch() throws VerdictDBException, SQLException {
  RelationStandardizer.resetItemID();
  String sql="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  stmt.execute("String_Node_Str");
  SelectQueryCoordinator coordinator=new SelectQueryCoordinator(new JdbcConnection(conn,new MysqlSyntax()));
  coordinator.setScrambleMetaSet(meta);
  coordinator.setDefaultSchema("String_Node_Str");
  ExecutionResultReader reader=coordinator.process(sql);
  NonValidatingSQLParser sqlToRelation=new NonValidatingSQLParser();
  AbstractRelation relation=sqlToRelation.toRelation(sql);
  RelationStandardizer gen=new RelationStandardizer(coordinator.getStaticMetaData());
  relation=gen.standardize((SelectQuery)relation);
  SelectQueryToSql selectQueryToSql=new SelectQueryToSql(new MysqlSyntax());
  String stdQuery=selectQueryToSql.toSql(relation);
  int cnt=0;
  while (reader.hasNext()) {
    DbmsQueryResult dbmsQueryResult=reader.next();
    cnt++;
    if (cnt == 12) {
      ResultSet rs=stmt.executeQuery(stdQuery);
      while (rs.next()) {
        dbmsQueryResult.next();
        assertEquals(rs.getString(1),dbmsQueryResult.getString(0));
        assertEquals(rs.getDouble(2),dbmsQueryResult.getDouble(1),1e-5);
      }
    }
  }
  assertEquals(12,cnt);
  stmt.execute("String_Node_Str");
  System.out.println("String_Node_Str");
}