Program: 95994
Project: 95994
Buggy source:
@Test public void Query17Test() 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";
  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());
  assertEquals(2,queryExecutionPlan.root.dependents.get(0).dependents.get(0).dependents.size());
  assertEquals(new BaseTable(placeholderSchemaName,placeholderTableName,"String_Node_Str"),((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0)).getSelectQuery().getFromList().get(0));
  JoinTable join=JoinTable.create(Arrays.<AbstractRelation>asList(new BaseTable(placeholderSchemaName,placeholderTableName,"String_Node_Str"),new BaseTable(placeholderSchemaName,placeholderTableName,"String_Node_Str")),Arrays.<JoinTable.JoinType>asList(JoinTable.JoinType.inner),Arrays.<UnnamedColumn>asList(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str")))));
  assertEquals(join,((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0).dependents.get(0)).getSelectQuery().getFromList().get(0));
  SelectQuery expected=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.asList(ConstantColumn.valueOf(0.2),new ColumnOp("String_Node_Str",new BaseColumn("String_Node_Str","String_Node_Str")))),"String_Node_Str")),new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str"));
  expected.addGroupby(new AliasReference("String_Node_Str"));
  expected.setAliasName("String_Node_Str");
  assertEquals(expected,((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0).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 Query17Test() 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";
  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());
  assertEquals(2,queryExecutionPlan.root.dependents.get(0).dependents.get(0).dependents.size());
  assertEquals(new BaseTable(placeholderSchemaName,placeholderTableName,"String_Node_Str"),((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0)).getSelectQuery().getFromList().get(0));
  JoinTable join=JoinTable.create(Arrays.<AbstractRelation>asList(new BaseTable(placeholderSchemaName,placeholderTableName,"String_Node_Str"),new BaseTable(placeholderSchemaName,placeholderTableName,"String_Node_Str")),Arrays.<JoinTable.JoinType>asList(JoinTable.JoinType.inner),Arrays.<UnnamedColumn>asList(new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(new BaseColumn("String_Node_Str","String_Node_Str"),new BaseColumn("String_Node_Str","String_Node_Str")))));
  assertEquals(join,((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0).dependents.get(0)).getSelectQuery().getFromList().get(0));
  SelectQuery expected=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.asList(ConstantColumn.valueOf(0.2),new ColumnOp("String_Node_Str",new BaseColumn("String_Node_Str","String_Node_Str")))),"String_Node_Str")),new BaseTable("String_Node_Str","String_Node_Str","String_Node_Str"));
  expected.addGroupby(new AliasReference("String_Node_Str"));
  expected.setAliasName("String_Node_Str");
  assertEquals(expected,((CreateTableAsSelectNode)queryExecutionPlan.root.dependents.get(0).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");
}