~jaypipes/drizzle/new-test-runner

« back to all changes in this revision

Viewing changes to drizzled/opt_range.h

  • Committer: Jay Pipes
  • Date: 2008-12-11 17:52:34 UTC
  • mfrom: (482.16.152 testable)
  • Revision ID: jpipes@serialcoder-20081211175234-uqsfvmgxejvmellq
merge with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
    reset() should be called when it is certain that row retrieval will be
179
179
    necessary. This call may do heavyweight initialization like buffering first
180
180
    N records etc. If reset() call fails get_next() must not be called.
181
 
    Note that reset() may be called several times if 
 
181
    Note that reset() may be called several times if
182
182
     * the quick select is executed in a subselect
183
183
     * a JOIN buffer is used
184
 
    
 
184
 
185
185
    RETURN
186
186
      0      OK
187
187
      other  Error code
301
301
  /* Range pointers to be used when not using MRR interface */
302
302
  QUICK_RANGE **cur_range;  /* current element in ranges  */
303
303
  QUICK_RANGE *last_range;
304
 
  
 
304
 
305
305
  /* Members needed to use the MRR interface */
306
306
  QUICK_RANGE_SEQ_CTX qr_traversal_ctx;
307
307
public:
308
308
  uint32_t mrr_flags; /* Flags to be used with MRR interface */
309
309
protected:
310
 
  uint32_t mrr_buf_size; /* copy from session->variables.read_rnd_buff_size */  
 
310
  uint32_t mrr_buf_size; /* copy from session->variables.read_rnd_buff_size */
311
311
  HANDLER_BUFFER *mrr_buf_desc; /* the handler buffer */
312
312
 
313
313
  /* Info about index we're scanning */
314
314
  KEY_PART *key_parts;
315
315
  KEY_PART_INFO *key_part_info;
316
 
  
 
316
 
317
317
  bool dont_free; /* Used by QUICK_SELECT_DESC */
318
318
 
319
319
  int cmp_next(QUICK_RANGE *range);
344
344
  QUICK_RANGE_SELECT(const QUICK_RANGE_SELECT& org) : QUICK_SELECT_I()
345
345
  {
346
346
    memmove(this, &org, sizeof(*this));
347
 
    /* 
 
347
    /*
348
348
      Use default MRR implementation for reverse scans. No table engine
349
349
      currently can do an MRR scan with output in reverse index order.
350
350
    */
357
357
  QUICK_RANGE_SELECT *get_quick_select_for_ref(Session *session, Table *table,
358
358
                                               struct st_table_ref *ref,
359
359
                                               ha_rows records);
360
 
  friend bool get_quick_keys(PARAM *param, QUICK_RANGE_SELECT *quick, 
361
 
                             KEY_PART *key, SEL_ARG *key_tree, 
 
360
  friend bool get_quick_keys(PARAM *param, QUICK_RANGE_SELECT *quick,
 
361
                             KEY_PART *key, SEL_ARG *key_tree,
362
362
                             unsigned char *min_key, uint32_t min_key_flag,
363
363
                             unsigned char *max_key, uint32_t max_key_flag);
364
364
  friend QUICK_RANGE_SELECT *get_quick_select(PARAM*,uint32_t idx,
527
527
  Session *session;       /* current thread */
528
528
  bool need_to_fetch_row; /* if true, do retrieve full table records. */
529
529
  /* in top-level quick select, true if merged scans where initialized */
530
 
  bool scans_inited; 
 
530
  bool scans_inited;
531
531
};
532
532
 
533
533
 
574
574
  uint32_t rowid_length;    /* table rowid length */
575
575
private:
576
576
  static int queue_cmp(void *arg, unsigned char *val1, unsigned char *val2);
577
 
  bool scans_inited; 
 
577
  bool scans_inited;
578
578
};
579
579
 
580
580
 
679
679
class QUICK_SELECT_DESC: public QUICK_RANGE_SELECT
680
680
{
681
681
public:
682
 
  QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint32_t used_key_parts, 
 
682
  QUICK_SELECT_DESC(QUICK_RANGE_SELECT *q, uint32_t used_key_parts,
683
683
                    bool *create_err);
684
684
  int get_next();
685
685
  bool reverse_sorted() { return 1; }