~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/filesort.cc

  • Committer: Brian Aker
  • Date: 2008-10-20 03:40:03 UTC
  • mto: (492.3.21 drizzle-clean-code)
  • mto: This revision was merged to the branch mainline in revision 530.
  • Revision ID: brian@tangent.org-20081020034003-t2dcnl0ayr2ymm8k
THD -> Session rename

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
static bool save_index(SORTPARAM *param,unsigned char **sort_keys, uint32_t count, 
46
46
                       filesort_info_st *table_sort);
47
47
static uint32_t suffix_length(uint32_t string_length);
48
 
static uint32_t sortlength(THD *thd, SORT_FIELD *sortorder, uint32_t s_length,
 
48
static uint32_t sortlength(Session *thd, SORT_FIELD *sortorder, uint32_t s_length,
49
49
                       bool *multi_byte_charset);
50
 
static SORT_ADDON_FIELD *get_addon_fields(THD *thd, Field **ptabfield,
 
50
static SORT_ADDON_FIELD *get_addon_fields(Session *thd, Field **ptabfield,
51
51
                                          uint32_t sortlength, uint32_t *plength);
52
52
static void unpack_addon_fields(struct st_sort_addon_field *addon_field,
53
53
                                unsigned char *buff);
87
87
    examined_rows       will be set to number of examined rows
88
88
*/
89
89
 
90
 
ha_rows filesort(THD *thd, Table *table, SORT_FIELD *sortorder, uint32_t s_length,
 
90
ha_rows filesort(Session *thd, Table *table, SORT_FIELD *sortorder, uint32_t s_length,
91
91
                 SQL_SELECT *select, ha_rows max_rows,
92
92
                 bool sort_positions, ha_rows *examined_rows)
93
93
{
444
444
  unsigned char *ref_pos,*next_pos,ref_buff[MAX_REFLENGTH];
445
445
  my_off_t record;
446
446
  Table *sort_form;
447
 
  THD *thd= current_thd;
448
 
  volatile THD::killed_state *killed= &thd->killed;
 
447
  Session *thd= current_thd;
 
448
  volatile Session::killed_state *killed= &thd->killed;
449
449
  handler *file;
450
450
  MY_BITMAP *save_read_set, *save_write_set;
451
451
 
1118
1118
  QUEUE queue;
1119
1119
  qsort2_cmp cmp;
1120
1120
  void *first_cmp_arg;
1121
 
  volatile THD::killed_state *killed= &current_thd->killed;
1122
 
  THD::killed_state not_killable;
 
1121
  volatile Session::killed_state *killed= &current_thd->killed;
 
1122
  Session::killed_state not_killable;
1123
1123
 
1124
1124
  status_var_increment(current_thd->status_var.filesort_merge_passes);
1125
1125
  if (param->not_killable)
1126
1126
  {
1127
1127
    killed= &not_killable;
1128
 
    not_killable= THD::NOT_KILLED;
 
1128
    not_killable= Session::NOT_KILLED;
1129
1129
  }
1130
1130
 
1131
1131
  error=0;
1352
1352
*/
1353
1353
 
1354
1354
static uint32_t
1355
 
sortlength(THD *thd, SORT_FIELD *sortorder, uint32_t s_length,
 
1355
sortlength(Session *thd, SORT_FIELD *sortorder, uint32_t s_length,
1356
1356
           bool *multi_byte_charset)
1357
1357
{
1358
1358
  register uint32_t length;
1457
1457
*/
1458
1458
 
1459
1459
static SORT_ADDON_FIELD *
1460
 
get_addon_fields(THD *thd, Field **ptabfield, uint32_t sortlength, uint32_t *plength)
 
1460
get_addon_fields(Session *thd, Field **ptabfield, uint32_t sortlength, uint32_t *plength)
1461
1461
{
1462
1462
  Field **pfield;
1463
1463
  Field *field;