~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.cc

Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
5793
5793
  uint32_t i, border= all_fields.size() - elements;
5794
5794
 
5795
5795
  if (param->field_count &&
5796
 
      !(copy=param->copy_field= new CopyField[param->field_count]))
5797
 
    goto err2;
 
5796
      !(copy= param->copy_field= new CopyField[param->field_count]))
 
5797
    return true;
5798
5798
 
5799
5799
  param->copy_funcs.clear();
5800
5800
  for (i= 0; (pos= li++); i++)
5829
5829
              copy_funcs
5830
5830
              (to see full test case look at having.test, BUG #4358)
5831
5831
            */
5832
 
        if (param->copy_funcs.push_front(pos))
5833
 
          goto err;
 
5832
        param->copy_funcs.push_front(pos);
5834
5833
      }
5835
5834
      else
5836
5835
      {
5871
5870
        on how the value is to be used: In some cases this may be an
5872
5871
        argument in a group function, like: IF(ISNULL(col),0,COUNT(*))
5873
5872
      */
5874
 
      if (!(pos=new Item_copy_string(pos)))
5875
 
        goto err;
 
5873
      pos=new Item_copy_string(pos);
5876
5874
      if (i < border)                           // HAVING, order_st and GROUP BY
5877
 
      {
5878
 
        if (extra_funcs.push_back(pos))
5879
 
          goto err;
5880
 
      }
5881
 
      else if (param->copy_funcs.push_back(pos))
5882
 
        goto err;
 
5875
        extra_funcs.push_back(pos);
 
5876
      else 
 
5877
                                param->copy_funcs.push_back(pos);
5883
5878
    }
5884
5879
    res_all_fields.push_back(pos);
5885
5880
    ref_pointer_array[((i < border)? all_fields.size()-i-1 : i-border)]=
5902
5897
  if (copy)
5903
5898
    delete [] param->copy_field;                        // This is never 0
5904
5899
  param->copy_field=0;
5905
 
err2:
5906
 
  return(true);
 
5900
  return true;
5907
5901
}
5908
5902
 
5909
5903
/**