Program: 95996
Project: 95996
Buggy source:
@Test public void SubqueryInFilterTest() throws VerdictDBException, SQLException {
  RelationStandardizer.resetItemID();
  String sql="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();
  String aliasName=String.format("String_Node_Str",queryExecutionPlan.getSerialNumber());
  SelectQuery rewritten=SelectQuery.create(Arrays.<SelectItem>asList(new AliasedColumn(new BaseColumn(placeholderSchemaName,aliasName,"String_Node_Str"),"String_Node_Str")),new BaseTable(placeholderSchemaName,placeholderTableName,aliasName));
  assertEquals(rewritten,((SubqueryColumn)((ColumnOp)((CreateTableAsSelectNode)(queryExecutionPlan.root.dependents.get(0))).getSelectQuery().getFilter().get()).getOperand(1)).getSubquery());
  SelectQuery expected=SelectQuery.create(Arrays.<SelectItem>asList(new AliasedColumn(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"));
  assertEquals(expected,((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 SubqueryInFilterTest() throws VerdictDBException, SQLException {
  RelationStandardizer.resetItemID();
  String sql="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();
  String aliasName=String.format("String_Node_Str",queryExecutionPlan.getSerialNumber());
  SelectQuery rewritten=SelectQuery.create(Arrays.<SelectItem>asList(new AliasedColumn(new BaseColumn(placeholderSchemaName,aliasName,"String_Node_Str"),"String_Node_Str")),new BaseTable(placeholderSchemaName,placeholderTableName,aliasName));
  assertEquals(rewritten,((SubqueryColumn)((ColumnOp)((CreateTableAsSelectNode)(queryExecutionPlan.root.dependents.get(0))).getSelectQuery().getFilter().get()).getOperand(1)).getSubquery());
  SelectQuery expected=SelectQuery.create(Arrays.<SelectItem>asList(new AliasedColumn(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"));
  assertEquals(expected,((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");
}