Program: 67887
Project: 67887
Buggy source:
/** 
 * @throws DataException
 */
private void initSaveRowUtil() throws DataException {
  rowExprsOs=streamManager.getOutStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  rowLenOs=streamManager.getOutStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  Map bindingNameColumnName=new HashMap();
  Set bindingNamesToSave=new HashSet();
  Map bindingNameType=new HashMap();
  Iterator it=this.queryDefn.getBindings().keySet().iterator();
  while (it.hasNext()) {
    String key=it.next().toString();
    IBinding binding=(IBinding)this.queryDefn.getBindings().get(key);
    if (this.streamManager.getVersion() >= VersionManager.VERSION_2_2_1_3 && this.queryDefn instanceof QueryDefinition && ((QueryDefinition)this.queryDefn).getQueryResultsID() == null && binding.getAggregatOns().size() == 0 && binding.getAggrFunction() == null) {
      IBaseExpression expr=binding.getExpression();
      if (expr instanceof IScriptExpression) {
        String expression=((IScriptExpression)expr).getText();
        String dataSetColumnName=this.getDataSetColumnName(expression);
        if (dataSetColumnName != null) {
          bindingNameColumnName.put(binding.getBindingName(),dataSetColumnName);
        }
      }
    }
    if (streamManager.getVersion() >= VersionManager.VERSION_2_5_1_0) {
      if (binding.getAggrFunction() != null)       continue;
    }
    if (bindingNameColumnName.get(binding.getBindingName()) == null || ((IQueryDefinition)this.queryDefn).isSummaryQuery())     bindingNamesToSave.add(binding.getBindingName());
    bindingNameType.put(binding.getBindingName(),new Integer(binding.getDataType()));
  }
  if (this.context.getMode() == DataEngineContext.MODE_UPDATE) {
    bindingNamesToSave.add(ExprMetaUtil.POS_NAME);
    bindingNameType.put(ExprMetaUtil.POS_NAME,DataType.INTEGER_TYPE);
  }
  this.rowSaveUtil=new RowSaveUtil(rowCount,rowExprsOs,rowLenOs,bindingNamesToSave,bindingNameColumnName,bindingNameType,this.streamManager.getVersion());
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void initSaveRowUtil() throws DataException {
  rowExprsOs=streamManager.getOutStream(DataEngineContext.EXPR_VALUE_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  rowLenOs=streamManager.getOutStream(DataEngineContext.EXPR_ROWLEN_STREAM,StreamManager.ROOT_STREAM,StreamManager.SELF_SCOPE);
  Map bindingNameColumnName=new HashMap();
  Set bindingNamesToSave=new HashSet();
  Map bindingNameType=new HashMap();
  Iterator it=this.queryDefn.getBindings().keySet().iterator();
  while (it.hasNext()) {
    String key=it.next().toString();
    IBinding binding=(IBinding)this.queryDefn.getBindings().get(key);
    if (this.streamManager.getVersion() >= VersionManager.VERSION_2_2_1_3 && this.queryDefn instanceof QueryDefinition && this.context.getMode() == DataEngineContext.MODE_GENERATION && binding.getAggregatOns().size() == 0 && binding.getAggrFunction() == null) {
      IBaseExpression expr=binding.getExpression();
      if (expr instanceof IScriptExpression) {
        String expression=((IScriptExpression)expr).getText();
        String dataSetColumnName=this.getDataSetColumnName(expression);
        if (dataSetColumnName != null) {
          bindingNameColumnName.put(binding.getBindingName(),dataSetColumnName);
        }
      }
    }
    if (streamManager.getVersion() >= VersionManager.VERSION_2_5_1_0) {
      if (binding.getAggrFunction() != null)       continue;
    }
    if (bindingNameColumnName.get(binding.getBindingName()) == null || ((IQueryDefinition)this.queryDefn).isSummaryQuery())     bindingNamesToSave.add(binding.getBindingName());
    bindingNameType.put(binding.getBindingName(),new Integer(binding.getDataType()));
  }
  if (this.context.getMode() == DataEngineContext.MODE_UPDATE) {
    bindingNamesToSave.add(ExprMetaUtil.POS_NAME);
    bindingNameType.put(ExprMetaUtil.POS_NAME,DataType.INTEGER_TYPE);
  }
  this.rowSaveUtil=new RowSaveUtil(rowCount,rowExprsOs,rowLenOs,bindingNamesToSave,bindingNameColumnName,bindingNameType,this.streamManager.getVersion());
}