~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/opt_range.h

  • Committer: mordred
  • Date: 2008-11-01 00:46:20 UTC
  • mto: (572.1.1 devel) (575.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 573.
  • Revision ID: mordred@opensolaris-20081101004620-vd0kzsl9k40hvf4p
Some updates to dtrace support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#ifndef DRIZZLED_OPT_RANGE_H
24
24
#define DRIZZLED_OPT_RANGE_H
25
25
 
26
 
#ifdef USE_PRAGMA_INTERFACE
27
 
#pragma interface                       /* gcc class implementation */
28
 
#endif
 
26
#include <mysys/queues.h>
29
27
 
30
28
typedef struct st_key_part {
31
29
  uint16_t           key,part;
302
300
public:
303
301
  uint32_t mrr_flags; /* Flags to be used with MRR interface */
304
302
protected:
305
 
  uint32_t mrr_buf_size; /* copy from thd->variables.read_rnd_buff_size */  
 
303
  uint32_t mrr_buf_size; /* copy from session->variables.read_rnd_buff_size */  
306
304
  HANDLER_BUFFER *mrr_buf_desc; /* the handler buffer */
307
305
 
308
306
  /* Info about index we're scanning */
317
315
public:
318
316
  MEM_ROOT alloc;
319
317
 
320
 
  QUICK_RANGE_SELECT(THD *thd, Table *table,uint32_t index_arg,bool no_alloc,
 
318
  QUICK_RANGE_SELECT(Session *session, Table *table,uint32_t index_arg,bool no_alloc,
321
319
                     MEM_ROOT *parent_alloc, bool *create_err);
322
320
  ~QUICK_RANGE_SELECT();
323
321
 
350
348
  }
351
349
  friend class TRP_ROR_INTERSECT;
352
350
  friend
353
 
  QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, Table *table,
 
351
  QUICK_RANGE_SELECT *get_quick_select_for_ref(Session *session, Table *table,
354
352
                                               struct st_table_ref *ref,
355
353
                                               ha_rows records);
356
354
  friend bool get_quick_keys(PARAM *param, QUICK_RANGE_SELECT *quick, 
436
434
class QUICK_INDEX_MERGE_SELECT : public QUICK_SELECT_I
437
435
{
438
436
public:
439
 
  QUICK_INDEX_MERGE_SELECT(THD *thd, Table *table);
 
437
  QUICK_INDEX_MERGE_SELECT(Session *session, Table *table);
440
438
  ~QUICK_INDEX_MERGE_SELECT();
441
439
 
442
440
  int  init();
461
459
  bool  doing_pk_scan;
462
460
 
463
461
  MEM_ROOT alloc;
464
 
  THD *thd;
 
462
  Session *session;
465
463
  int read_keys_and_merge();
466
464
 
467
465
  /* used to get rows collected in Unique */
490
488
class QUICK_ROR_INTERSECT_SELECT : public QUICK_SELECT_I
491
489
{
492
490
public:
493
 
  QUICK_ROR_INTERSECT_SELECT(THD *thd, Table *table,
 
491
  QUICK_ROR_INTERSECT_SELECT(Session *session, Table *table,
494
492
                             bool retrieve_full_rows,
495
493
                             MEM_ROOT *parent_alloc);
496
494
  ~QUICK_ROR_INTERSECT_SELECT();
520
518
  QUICK_RANGE_SELECT *cpk_quick;
521
519
 
522
520
  MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */
523
 
  THD *thd;       /* current thread */
 
521
  Session *session;       /* current thread */
524
522
  bool need_to_fetch_row; /* if true, do retrieve full table records. */
525
523
  /* in top-level quick select, true if merged scans where initialized */
526
524
  bool scans_inited; 
543
541
class QUICK_ROR_UNION_SELECT : public QUICK_SELECT_I
544
542
{
545
543
public:
546
 
  QUICK_ROR_UNION_SELECT(THD *thd, Table *table);
 
544
  QUICK_ROR_UNION_SELECT(Session *session, Table *table);
547
545
  ~QUICK_ROR_UNION_SELECT();
548
546
 
549
547
  int  init();
563
561
  QUEUE queue;    /* Priority queue for merge operation */
564
562
  MEM_ROOT alloc; /* Memory pool for this and merged quick selects data. */
565
563
 
566
 
  THD *thd;             /* current thread */
 
564
  Session *session;             /* current thread */
567
565
  unsigned char *cur_rowid;      /* buffer used in get_next() */
568
566
  unsigned char *prev_rowid;     /* rowid of last row returned by get_next() */
569
567
  bool have_prev_rowid; /* true if prev_rowid has valid data */
707
705
  SQL_SELECT();
708
706
  ~SQL_SELECT();
709
707
  void cleanup();
710
 
  bool check_quick(THD *thd, bool force_quick_range, ha_rows limit)
 
708
  bool check_quick(Session *session, bool force_quick_range, ha_rows limit)
711
709
  {
712
710
    key_map tmp;
713
711
    tmp.set_all();
714
 
    return test_quick_select(thd, tmp, 0, limit, force_quick_range, false) < 0;
 
712
    return test_quick_select(session, tmp, 0, limit, force_quick_range, false) < 0;
715
713
  }
716
714
  inline bool skip_record() { return cond ? cond->val_int() == 0 : 0; }
717
 
  int test_quick_select(THD *thd, key_map keys, table_map prev_tables,
 
715
  int test_quick_select(Session *session, key_map keys, table_map prev_tables,
718
716
                        ha_rows limit, bool force_quick_range, 
719
717
                        bool ordered_output);
720
718
};
721
719
 
722
 
QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, Table *table,
 
720
QUICK_RANGE_SELECT *get_quick_select_for_ref(Session *session, Table *table,
723
721
                                             struct st_table_ref *ref,
724
722
                                             ha_rows records);
725
723
uint32_t get_index_for_order(Table *table, order_st *order, ha_rows limit);