Program: 95986
Project: 95986
Buggy source:
@Test public void Query9Test() 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"+ "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";
  NonValidatingSQLParser sqlToRelation=new NonValidatingSQLParser();
  AbstractRelation relation=sqlToRelation.toRelation(sql);
  RelationStandardizer gen=new RelationStandardizer(staticMetaData);
  relation=gen.standardize((SelectQuery)relation);
  QueryExecutionPlan queryExecutionPlan=new QueryExecutionPlan("String_Node_Str",meta,(SelectQuery)relation);
  queryExecutionPlan.cleanUp();
  assertEquals(1,queryExecutionPlan.root.dependents.get(0).dependents.size());
  AbstractRelation part=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation supplier=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation lineitem=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation partsupp=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation orders=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation nation=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  SelectQuery subquery=SelectQuery.create(Arrays.<SelectItem>asList(new AliasedColumn(new BaseColumn("String_Node_Str","String_Node_Str"),"String_Node_Str"),new AliasedColumn(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),ConstantColumn.valueOf(0),ConstantColumn.valueOf(4))),"String_Node_Str"),new AliasedColumn(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(ConstantColumn.valueOf(1),new BaseColumn("String_Node_Str","String_Node_Str"))))),new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))))),"String_Node_Str")),Arrays.asList(part,supplier,lineitem,partsupp,orders,nation));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),ConstantColumn.valueOf("String_Node_Str"))));
  subquery.setAliasName("String_Node_Str");
  SelectQuery expected=SelectQuery.create(Arrays.<SelectItem>asList(new AliasedColumn(new BaseColumn("String_Node_Str","String_Node_Str"),"String_Node_Str"),new AliasedColumn(new BaseColumn("String_Node_Str","String_Node_Str"),"String_Node_Str"),new AliasedColumn(new ColumnOp("String_Node_Str",new BaseColumn("String_Node_Str","String_Node_Str")),"String_Node_Str")),new BaseTable(placeholderSchemaName,placeholderTableName,"String_Node_Str"));
  expected.addGroupby(Arrays.<GroupingAttribute>asList(new AliasReference("String_Node_Str"),new AliasReference("String_Node_Str")));
  expected.addOrderby(Arrays.<OrderbyAttribute>asList(new OrderbyAttribute("String_Node_Str"),new OrderbyAttribute("String_Node_Str","String_Node_Str")));
  expected.addLimit(ConstantColumn.valueOf(1));
  assertEquals(expected,((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0)).selectQuery);
  assertEquals(subquery,((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0).dependents.get(0)).selectQuery);
  stmt.execute("String_Node_Str");
  ExecutablePlanRunner.runTillEnd(new JdbcConnection(conn,new H2Syntax()),queryExecutionPlan);
  stmt.execute("String_Node_Str");
}

Fixed version (ground truth):
public void Query9Test() 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"+ "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";
  NonValidatingSQLParser sqlToRelation=new NonValidatingSQLParser();
  AbstractRelation relation=sqlToRelation.toRelation(sql);
  RelationStandardizer gen=new RelationStandardizer(staticMetaData);
  relation=gen.standardize((SelectQuery)relation);
  QueryExecutionPlan queryExecutionPlan=new QueryExecutionPlan("String_Node_Str",meta,(SelectQuery)relation);
  queryExecutionPlan.cleanUp();
  assertEquals(1,queryExecutionPlan.root.dependents.get(0).dependents.size());
  AbstractRelation part=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation supplier=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation lineitem=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation partsupp=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation orders=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  AbstractRelation nation=new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str");
  SelectQuery subquery=SelectQuery.create(Arrays.<SelectItem>asList(new AliasedColumn(new BaseColumn("String_Node_Str","String_Node_Str"),"String_Node_Str"),new AliasedColumn(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),ConstantColumn.valueOf(0),ConstantColumn.valueOf(4))),"String_Node_Str"),new AliasedColumn(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(ConstantColumn.valueOf(1),new BaseColumn("String_Node_Str","String_Node_Str"))))),new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))))),"String_Node_Str")),Arrays.asList(part,supplier,lineitem,partsupp,orders,nation));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str"))));
  subquery.addFilterByAnd(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),ConstantColumn.valueOf("String_Node_Str"))));
  subquery.setAliasName("String_Node_Str");
  SelectQuery expected=SelectQuery.create(Arrays.<SelectItem>asList(new AliasedColumn(new BaseColumn("String_Node_Str","String_Node_Str"),"String_Node_Str"),new AliasedColumn(new BaseColumn("String_Node_Str","String_Node_Str"),"String_Node_Str"),new AliasedColumn(new ColumnOp("String_Node_Str",new BaseColumn("String_Node_Str","String_Node_Str")),"String_Node_Str")),new BaseTable(placeholderSchemaName,placeholderTableName,"String_Node_Str"));
  expected.addGroupby(Arrays.<GroupingAttribute>asList(new AliasReference("String_Node_Str"),new AliasReference("String_Node_Str")));
  expected.addOrderby(Arrays.<OrderbyAttribute>asList(new OrderbyAttribute("String_Node_Str"),new OrderbyAttribute("String_Node_Str","String_Node_Str")));
  expected.addLimit(ConstantColumn.valueOf(1));
  assertEquals(expected,((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0)).selectQuery);
  assertEquals(subquery,((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0).dependents.get(0)).selectQuery);
  stmt.execute("String_Node_Str");
  ExecutablePlanRunner.runTillEnd(new JdbcConnection(conn,new H2Syntax()),queryExecutionPlan);
  stmt.execute("String_Node_Str");
}