Program: 96026
Project: 96026
Buggy source:
@Test public void SimpleAggregateWithScrambleTableTest() throws VerdictDBException {
  String sql="String_Node_Str";
  NonValidatingSQLParser sqlToRelation=new NonValidatingSQLParser();
  SelectQuery selectQuery=(SelectQuery)sqlToRelation.toRelation(sql);
  QueryExecutionPlan queryExecutionPlan=new QueryExecutionPlan(newSchema,null,selectQuery);
  BaseTable base=new BaseTable(originalSchema,originalTable,"String_Node_Str");
  SelectQuery leftQuery=SelectQuery.create(new AliasedColumn(ColumnOp.count(),"String_Node_Str"),base);
  leftQuery.addFilterByAnd(ColumnOp.lessequal(new BaseColumn("String_Node_Str","String_Node_Str"),ConstantColumn.valueOf(5.0)));
  SelectQuery rightQuery=SelectQuery.create(new AliasedColumn(ColumnOp.count(),"String_Node_Str"),base);
  rightQuery.addFilterByAnd(ColumnOp.greater(new BaseColumn("String_Node_Str","String_Node_Str"),ConstantColumn.valueOf(5.0)));
  AggExecutionNode leftNode=AggExecutionNode.create(null,leftQuery);
  AggExecutionNode rightNode=AggExecutionNode.create(null,rightQuery);
  ExecutionTokenQueue queue=new ExecutionTokenQueue();
  AggCombinerExecutionNode combiner=AggCombinerExecutionNode.create(queryExecutionPlan,leftNode,rightNode);
  combiner.addBroadcastingQueue(queue);
  AsyncAggExecutionNode asyncAggExecutionNode=AsyncAggExecutionNode.create(queryExecutionPlan,Arrays.<QueryExecutionNode>asList(leftNode,rightNode),Arrays.<QueryExecutionNode>asList(combiner));
  queryExecutionPlan.root.getDependents().remove(0);
  queryExecutionPlan.root.getListeningQueues().remove(0);
  asyncAggExecutionNode.addBroadcastingQueue(queryExecutionPlan.root.generateListeningQueue());
  queryExecutionPlan.root.addDependency(asyncAggExecutionNode);
  QueryExecutionNode copy=queryExecutionPlan.root.deepcopy();
  queryExecutionPlan.compress();
  assertEquals(asyncAggExecutionNode,queryExecutionPlan.root.dependents.get(0));
  assertEquals(copy.selectQuery,queryExecutionPlan.root.selectQuery);
}

Fixed version (ground truth):
@Test public void SimpleAggregateWithScrambleTableTest() throws VerdictDBException {
  String sql="String_Node_Str";
  NonValidatingSQLParser sqlToRelation=new NonValidatingSQLParser();
  SelectQuery selectQuery=(SelectQuery)sqlToRelation.toRelation(sql);
  QueryExecutionPlan queryExecutionPlan=new QueryExecutionPlan(newSchema,null,selectQuery);
  BaseTable base=new BaseTable(originalSchema,originalTable,"String_Node_Str");
  SelectQuery leftQuery=SelectQuery.create(new AliasedColumn(ColumnOp.count(),"String_Node_Str"),base);
  leftQuery.addFilterByAnd(ColumnOp.lessequal(new BaseColumn("String_Node_Str","String_Node_Str"),ConstantColumn.valueOf(5.0)));
  SelectQuery rightQuery=SelectQuery.create(new AliasedColumn(ColumnOp.count(),"String_Node_Str"),base);
  rightQuery.addFilterByAnd(ColumnOp.greater(new BaseColumn("String_Node_Str","String_Node_Str"),ConstantColumn.valueOf(5.0)));
  AggExecutionNode leftNode=AggExecutionNode.create(null,leftQuery);
  AggExecutionNode rightNode=AggExecutionNode.create(null,rightQuery);
  ExecutionTokenQueue queue=new ExecutionTokenQueue();
  AggCombinerExecutionNode combiner=AggCombinerExecutionNode.create(queryExecutionPlan,leftNode,rightNode);
  combiner.addBroadcastingQueue(queue);
  AsyncAggExecutionNode asyncAggExecutionNode=AsyncAggExecutionNode.create(queryExecutionPlan,Arrays.<QueryExecutionNode>asList(leftNode,rightNode),Arrays.<QueryExecutionNode>asList(combiner));
  queryExecutionPlan.root.getDependents().remove(0);
  queryExecutionPlan.root.getListeningQueues().remove(0);
  ExecutionTokenQueue q=new ExecutionTokenQueue();
  queryExecutionPlan.root.getListeningQueues().add(q);
  asyncAggExecutionNode.addBroadcastingQueue(q);
  queryExecutionPlan.root.addDependency(asyncAggExecutionNode);
  QueryExecutionNode copy=queryExecutionPlan.root.deepcopy();
  queryExecutionPlan.compress();
  assertEquals(asyncAggExecutionNode,queryExecutionPlan.root.dependents.get(0));
  assertEquals(copy.selectQuery,queryExecutionPlan.root.selectQuery);
}