~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/quick_range_select.h

  • Committer: Monty Taylor
  • Date: 2010-05-12 05:00:55 UTC
  • mto: (1527.1.5 staging)
  • mto: This revision was merged to the branch mainline in revision 1529.
  • Revision ID: mordred@inaugust.com-20100512050055-i0kvg8xpr9dupz54
Wrap the libraries in if BUILD_*_PLUGIN so that they don't build when we're
disabling.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2008-2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
20
20
#ifndef DRIZZLED_OPTIMIZER_QUICK_RANGE_SELECT_H
21
21
#define DRIZZLED_OPTIMIZER_QUICK_RANGE_SELECT_H
22
22
 
23
 
#include <drizzled/optimizer/range.h>
 
23
#include "drizzled/optimizer/range.h"
24
24
 
25
 
#include <boost/dynamic_bitset.hpp>
26
25
#include <vector>
27
26
 
28
27
namespace drizzled
47
46
 
48
47
  /** Members to deal with case when this quick select is a ROR-merged scan */
49
48
  bool in_ror_merged_scan;
50
 
  boost::dynamic_bitset<> *column_bitmap;
51
 
  boost::dynamic_bitset<> *save_read_set;
52
 
  boost::dynamic_bitset<> *save_write_set;
 
49
  MyBitmap column_bitmap;
 
50
  MyBitmap *save_read_set;
 
51
  MyBitmap *save_write_set;
53
52
  bool free_file; /**< True when this->file is "owned" by this quick select */
54
53
 
55
54
  /* Range pointers to be used when not using MRR interface */
59
58
  /** Members needed to use the MRR interface */
60
59
  QuickRangeSequenceContext qr_traversal_ctx;
61
60
  uint32_t mrr_buf_size; /**< copy from session->variables.read_rnd_buff_size */
 
61
  HANDLER_BUFFER *mrr_buf_desc; /**< the Cursor buffer */
62
62
 
63
63
  /** Info about index we're scanning */
64
64
  KEY_PART *key_parts;
65
 
  KeyPartInfo *key_part_info;
 
65
  KEY_PART_INFO *key_part_info;
66
66
 
67
67
  bool dont_free; /**< Used by QuickSelectDescending */
68
68
 
107
107
                     Table *table,
108
108
                     uint32_t index_arg,
109
109
                     bool no_alloc,
110
 
                     memory::Root *parent_alloc);
 
110
                     memory::Root *parent_alloc,
 
111
                     bool *create_err);
111
112
 
112
113
  ~QuickRangeSelect();
113
114
 
122
123
   * QuickRangeSelect::get_next()
123
124
   *
124
125
   * NOTES
125
 
   * Record is read into table->getInsertRecord()
 
126
   * Record is read into table->record[0]
126
127
   *
127
128
   * RETURN
128
129
   * @retval 0                  Found row
203
204
    return QS_TYPE_RANGE;
204
205
  }
205
206
 
206
 
  void add_keys_and_lengths(std::string *key_names, std::string *used_lengths);
 
207
  void add_keys_and_lengths(String *key_names, String *used_lengths);
207
208
 
208
 
  void add_info_string(std::string *str);
 
209
  void add_info_string(String *str);
209
210
 
210
211
  void resetCursor()
211
212
  {
222
223
      Use default MRR implementation for reverse scans. No table engine
223
224
      currently can do an MRR scan with output in reverse index order.
224
225
    */
 
226
    mrr_buf_desc= NULL;
225
227
    mrr_flags|= HA_MRR_USE_DEFAULT_IMPL;
226
228
    mrr_buf_size= 0;
227
229
  }
262
264
                                          uint32_t n_ranges, 
263
265
                                          uint32_t flags);
264
266
 
265
 
  friend void select_describe(Join *join, 
 
267
  friend void select_describe(JOIN *join, 
266
268
                              bool need_tmp_table, 
267
269
                              bool need_order,
268
270
                              bool distinct,