~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/filesort.cc

  • Committer: Brian Aker
  • Date: 2010-06-03 09:06:27 UTC
  • mto: (1578.6.10 explain-drizzle)
  • mto: This revision was merged to the branch mainline in revision 1589.
  • Revision ID: brian@gir-2.local-20100603090627-6doyyne204s9wo1r
PAss through the code removing current_session

Show diffs side-by-side

added added

removed removed

Lines of Context:
56
56
                                             uint32_t count,
57
57
                                             unsigned char *buf);
58
58
 
59
 
static ha_rows find_all_keys(SORTPARAM *param,
 
59
static ha_rows find_all_keys(Session *session,
 
60
                             SORTPARAM *param,
60
61
                             optimizer::SqlSelect *select,
61
62
                             unsigned char * *sort_keys, 
62
63
                             internal::IO_CACHE *buffer_file,
267
268
  param.keys--;                         /* TODO: check why we do this */
268
269
  param.sort_form= table;
269
270
  param.end=(param.local_sortorder=sortorder)+s_length;
270
 
  if ((records=find_all_keys(&param,select,sort_keys, &buffpek_pointers,
 
271
  if ((records=find_all_keys(session, &param,select,sort_keys, &buffpek_pointers,
271
272
                             &tempfile, selected_records_file)) ==
272
273
      HA_POS_ERROR)
273
274
    goto err;
473
474
    HA_POS_ERROR on error.
474
475
*/
475
476
 
476
 
static ha_rows find_all_keys(SORTPARAM *param, 
 
477
static ha_rows find_all_keys(Session *session,
 
478
                             SORTPARAM *param, 
477
479
                             optimizer::SqlSelect *select,
478
480
                             unsigned char **sort_keys,
479
481
                             internal::IO_CACHE *buffpek_pointers,
484
486
  unsigned char *ref_pos,*next_pos,ref_buff[MAX_REFLENGTH];
485
487
  internal::my_off_t record;
486
488
  Table *sort_form;
487
 
  Session *session= current_session;
488
489
  volatile Session::killed_state *killed= &session->killed;
489
490
  Cursor *file;
490
491
  MyBitmap *save_read_set, *save_write_set;
507
508
    next_pos=(unsigned char*) 0;                        /* Find records in sequence */
508
509
    file->startTableScan(1);
509
510
    file->extra_opt(HA_EXTRA_CACHE,
510
 
                    current_session->variables.read_buff_size);
 
511
                    session->variables.read_buff_size);
511
512
  }
512
513
 
513
514
  ReadRecord read_record_info;
516
517
    if (select->quick->reset())
517
518
      return(HA_POS_ERROR);
518
519
 
519
 
    read_record_info.init_read_record(current_session, select->quick->head, select, 1, 1);
 
520
    read_record_info.init_read_record(session, select->quick->head, select, 1, 1);
520
521
  }
521
522
 
522
523
  /* Remember original bitmaps */