Program: 96019
Project: 96019
Buggy source:
public static AsyncAggScaleExecutionNode create(QueryExecutionPlan plan,AggExecutionNode aggNode) throws VerdictDBException {
  AsyncAggScaleExecutionNode node=new AsyncAggScaleExecutionNode(plan);
  List<SelectItem> newSelectList=aggNode.getSelectQuery().deepcopy().getSelectList();
  for (  SelectItem selectItem : newSelectList) {
    if (selectItem instanceof AliasedColumn) {
      int index=newSelectList.indexOf(selectItem);
      UnnamedColumn col=((AliasedColumn)selectItem).getColumn();
      if (AsyncAggScaleExecutionNode.isAggregateColumn(col)) {
        ColumnOp aggColumn=new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(ConstantColumn.valueOf(node.scaleFactor),col));
        node.aggColumnlist.add(aggColumn);
        newSelectList.set(index,new AliasedColumn(aggColumn,((AliasedColumn)selectItem).getAliasName()));
      }
    }
  }
  Pair<BaseTable,ExecutionTokenQueue> baseAndQueue=node.createPlaceHolderTable("String_Node_Str");
  SelectQuery query=SelectQuery.create(newSelectList,baseAndQueue.getLeft());
  node.setSelectQuery(query);
  for (  QueryExecutionNode parent : aggNode.getParents()) {
    int index=parent.dependents.indexOf(aggNode);
    ExecutionTokenQueue queue=new ExecutionTokenQueue();
    parent.getListeningQueues().set(index,queue);
    node.addBroadcastingQueue(queue);
    parent.dependents.set(index,node);
  }
  aggNode.getBroadcastingQueues().clear();
  aggNode.addBroadcastingQueue(baseAndQueue.getRight());
  aggNode.getParents().clear();
  aggNode.getParents().add(node);
  return node;
}

Fixed version (ground truth):
public static AsyncAggScaleExecutionNode create(QueryExecutionPlan plan,AggExecutionNode aggNode) throws VerdictDBException {
  AsyncAggScaleExecutionNode node=new AsyncAggScaleExecutionNode(plan);
  Pair<BaseTable,ExecutionTokenQueue> baseAndQueue=node.createPlaceHolderTable("String_Node_Str");
  List<SelectItem> newSelectList=aggNode.getSelectQuery().deepcopy().getSelectList();
  for (  SelectItem selectItem : newSelectList) {
    if (selectItem instanceof AliasedColumn) {
      int index=newSelectList.indexOf(selectItem);
      UnnamedColumn col=((AliasedColumn)selectItem).getColumn();
      if (AsyncAggScaleExecutionNode.isAggregateColumn(col)) {
        ColumnOp aggColumn=new ColumnOp("String_Node_Str",Arrays.<UnnamedColumn>asList(ConstantColumn.valueOf(node.scaleFactor),new BaseColumn("String_Node_Str",((AliasedColumn)selectItem).getAliasName())));
        node.aggColumnlist.add(aggColumn);
        newSelectList.set(index,new AliasedColumn(aggColumn,((AliasedColumn)selectItem).getAliasName()));
      }
 else {
        newSelectList.set(index,new AliasedColumn(new BaseColumn("String_Node_Str",((AliasedColumn)selectItem).getAliasName()),((AliasedColumn)selectItem).getAliasName()));
      }
    }
  }
  SelectQuery query=SelectQuery.create(newSelectList,baseAndQueue.getLeft());
  node.setSelectQuery(query);
  for (  QueryExecutionNode parent : aggNode.getParents()) {
    int index=parent.dependents.indexOf(aggNode);
    ExecutionTokenQueue queue=new ExecutionTokenQueue();
    if (parent instanceof AsyncAggExecutionNode) {
      node.addBroadcastingQueue(parent.getListeningQueue(0));
    }
 else {
      parent.getListeningQueues().set(index,queue);
      node.addBroadcastingQueue(queue);
    }
    parent.dependents.set(index,node);
    node.addParent(parent);
  }
  aggNode.getBroadcastingQueues().clear();
  aggNode.addBroadcastingQueue(baseAndQueue.getRight());
  aggNode.getParents().clear();
  node.addDependency(aggNode);
  return node;
}