~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/join.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 22:23:29 UTC
  • mto: This revision was merged to the branch mainline in revision 2348.
  • Revision ID: olafvdspek@gmail.com-20110622222329-nnn26zfomy4tsxak
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
734
734
  if (!tables_list)
735
735
  {
736
736
    error= 0;
737
 
    return(0);
 
737
    return 0;
738
738
  }
739
739
  error= -1;          // Error is sent to client
740
740
  sort_by_table= get_sort_by_table(order, group_list, select_lex->leaf_tables);
1134
1134
  if (select_options & SELECT_DESCRIBE)
1135
1135
  {
1136
1136
    error= 0;
1137
 
    return(0);
 
1137
    return 0;
1138
1138
  }
1139
1139
  having= 0;
1140
1140
 
1327
1327
      func->clear();
1328
1328
  }
1329
1329
 
1330
 
  return(0);
 
1330
  return 0;
1331
1331
}
1332
1332
 
1333
1333
/**
3366
3366
  optimizer::Position cur_pos;
3367
3367
 
3368
3368
  table_count=join->tables;
3369
 
  join->join_tab=join_tab= (JoinTable*) session->mem.alloc(sizeof(JoinTable)*table_count);
3370
 
 
3371
 
  for (i= 0; i < table_count; i++)
3372
 
    new (join_tab+i) JoinTable();
3373
 
 
 
3369
  join->join_tab=join_tab= new (session->mem) JoinTable[table_count];
3374
3370
  join->full_join=0;
3375
3371
 
3376
3372
  used_tables= OUTER_REF_TABLE_BIT;   // Outer row is already read
3405
3401
  for (i=0 ; i < table_count ; i++)
3406
3402
    join->map2table[join->join_tab[i].table->tablenr]=join->join_tab+i;
3407
3403
  update_depend_map(join);
3408
 
  return(0);
 
3404
  return 0;
3409
3405
}
3410
3406
 
3411
3407
/** Save const tables first as used tables. */
5014
5010
      }
5015
5011
    }
5016
5012
  }
5017
 
  return(0);
 
5013
  return 0;
5018
5014
}
5019
5015
 
5020
5016
/*
5527
5523
  if (!field_count && !(join->select_options & OPTION_FOUND_ROWS) && !having)
5528
5524
  {                    // only const items with no OPTION_FOUND_ROWS
5529
5525
    join->unit->select_limit_cnt= 1;            // Only send first row
5530
 
    return(0);
 
5526
    return 0;
5531
5527
  }
5532
5528
  Field **first_field=entry->getFields() + entry->getShare()->sizeFields() - field_count;
5533
5529
  uint32_t offset= field_count ? entry->getField(entry->getShare()->sizeFields() - field_count)->offset(entry->getInsertRecord()) : 0;