~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Brian Aker
  • Date: 2011-02-18 16:48:57 UTC
  • mfrom: (2180.1.3 drizzle-staging)
  • Revision ID: brian@tangent.org-20110218164857-4n61en8wai9c91gi
Rollup all of Olaf's branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2112
2112
      We can't call delete_elements() on copy_funcs as this will cause
2113
2113
      problems in free_elements() as some of the elements are then deleted.
2114
2114
    */
2115
 
    tmp_table_param.copy_funcs.empty();
 
2115
    tmp_table_param.copy_funcs.clear();
2116
2116
    /*
2117
2117
      If we have tmp_join and 'this' Join is not tmp_join and
2118
2118
      tmp_table_param.copy_field's  of them are equal then we have to remove
2281
2281
  {
2282
2282
    rollup.getNullItems()[i]= new (session->mem_root) Item_null_result();
2283
2283
    List<Item> *rollup_fields= &rollup.getFields()[i];
2284
 
    rollup_fields->empty();
 
2284
    rollup_fields->clear();
2285
2285
    rollup.getRefPointerArrays()[i]= ref_array;
2286
2286
    ref_array+= all_fields.elements;
2287
2287
  }
2294
2294
    }
2295
2295
  }
2296
2296
 
2297
 
  List_iterator<Item> it(all_fields);
 
2297
  List<Item>::iterator it(all_fields);
2298
2298
  Item *item;
2299
2299
  while ((item= it++))
2300
2300
  {
2400
2400
    uint32_t pos= send_group_parts - level -1;
2401
2401
    bool real_fields= 0;
2402
2402
    Item *item;
2403
 
    List_iterator<Item> new_it(rollup.getFields()[pos]);
 
2403
    List<Item>::iterator new_it(rollup.getFields()[pos]);
2404
2404
    Item **ref_array_start= rollup.getRefPointerArrays()[pos];
2405
2405
    Order *start_group;
2406
2406
 
2414
2414
    for (i= 0, start_group= group_list ;i++ < pos ;start_group= start_group->next)
2415
2415
    {}
2416
2416
 
2417
 
    it.rewind();
 
2417
    it= fields_arg;
2418
2418
    while ((item= it++))
2419
2419
    {
2420
2420
      if (item == first_field)
5430
5430
  TableList *table;
5431
5431
  NestedJoin *nested_join;
5432
5432
  TableList *prev_table= 0;
5433
 
  List_iterator<TableList> li(*join_list);
 
5433
  List<TableList>::iterator li(*join_list);
5434
5434
 
5435
5435
  /*
5436
5436
    Try to simplify join operations from join_list.
5566
5566
    Flatten nested joins that can be flattened.
5567
5567
    no ON expression and not a semi-join => can be flattened.
5568
5568
  */
5569
 
  li.rewind();
 
5569
  li= *join_list;
5570
5570
  while ((table= li++))
5571
5571
  {
5572
5572
    nested_join= table->getNestedJoin();
5573
5573
    if (nested_join && !table->on_expr)
5574
5574
    {
5575
5575
      TableList *tbl;
5576
 
      List_iterator<TableList> it(nested_join->join_list);
 
5576
      List<TableList>::iterator it(nested_join->join_list);
5577
5577
      while ((tbl= it++))
5578
5578
      {
5579
5579
        tbl->setEmbedding(table->getEmbedding());
5596
5596
 
5597
5597
  /* Calculate how many saved fields there is in list */
5598
5598
  field_count=0;
5599
 
  List_iterator<Item> it(fields);
 
5599
  List<Item>::iterator it(fields);
5600
5600
  Item *item;
5601
5601
  while ((item=it++))
5602
5602
  {
6138
6138
*/
6139
6139
static uint32_t build_bitmap_for_nested_joins(List<TableList> *join_list, uint32_t first_unused)
6140
6140
{
6141
 
  List_iterator<TableList> li(*join_list);
 
6141
  List<TableList>::iterator li(*join_list);
6142
6142
  TableList *table;
6143
6143
  while ((table= li++))
6144
6144
  {
6209
6209
*/
6210
6210
static void reset_nj_counters(List<TableList> *join_list)
6211
6211
{
6212
 
  List_iterator<TableList> li(*join_list);
 
6212
  List<TableList>::iterator li(*join_list);
6213
6213
  TableList *table;
6214
6214
  while ((table= li++))
6215
6215
  {