~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/table_read_plan.h

Merge in security refactor.

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_TABLE_READ_PLAN_H
21
21
#define DRIZZLED_OPTIMIZER_TABLE_READ_PLAN_H
22
22
 
23
 
#include "drizzled/util/functors.h"
24
 
#include <algorithm>
25
 
 
26
23
namespace drizzled
27
24
{
28
25
 
 
26
class SEL_TREE;
 
27
struct st_ror_scan_info;
 
28
 
29
29
namespace optimizer
30
30
{
31
31
 
32
32
class Parameter;
33
33
class SEL_ARG;
34
 
class SEL_TREE;
35
 
class RorScanInfo;
36
34
 
37
35
/*
38
36
  Table rows retrieval plan. Range optimizer creates QuickSelectInterface-derived
77
75
  /* Table read plans are allocated on memory::Root and are never deleted */
78
76
  static void *operator new(size_t size, memory::Root *mem_root)
79
77
  { 
80
 
    return (void*) mem_root->alloc_root((uint32_t) size); 
 
78
    return (void*) alloc_root(mem_root, (uint32_t) size); 
81
79
  }
82
80
 
83
81
  static void operator delete(void *, size_t)
124
122
class RorIntersectReadPlan : public TableReadPlan
125
123
{
126
124
public:
127
 
 
128
125
  RorIntersectReadPlan() {}                      /* Remove gcc warning */
129
126
  virtual ~RorIntersectReadPlan() {}             /* Remove gcc warning */
130
 
 
131
127
  QuickSelectInterface *make_quick(Parameter *param,
132
128
                                   bool retrieve_full_rows,
133
129
                                   memory::Root *parent_alloc);
134
130
 
135
131
  /* Array of pointers to ROR range scans used in this intersection */
136
 
  RorScanInfo **first_scan;
137
 
  RorScanInfo **last_scan; /* End of the above array */
138
 
  RorScanInfo *cpk_scan;  /* Clustered PK scan, if there is one */
139
 
 
 
132
  struct st_ror_scan_info **first_scan;
 
133
  struct st_ror_scan_info **last_scan; /* End of the above array */
 
134
  struct st_ror_scan_info *cpk_scan;  /* Clustered PK scan, if there is one */
140
135
  bool is_covering; /* true if no row retrieval phase is necessary */
141
136
  double index_scan_costs; /* SUM(cost(index_scan)) */
142
 
 
143
137
};
144
138
 
145
139
 
190
184
private:
191
185
  bool have_min;
192
186
  bool have_max;
193
 
  KeyPartInfo *min_max_arg_part;
 
187
  KEY_PART_INFO *min_max_arg_part;
194
188
  uint32_t group_prefix_len;
195
189
  uint32_t used_key_parts;
196
190
  uint32_t group_key_parts;
197
 
  KeyInfo *index_info;
 
191
  KEY *index_info;
198
192
  uint32_t index;
199
193
  uint32_t key_infix_len;
200
194
  unsigned char key_infix[MAX_KEY_LENGTH];
208
202
public:
209
203
  GroupMinMaxReadPlan(bool have_min_arg, 
210
204
                      bool have_max_arg,
211
 
                      KeyPartInfo *min_max_arg_part_arg,
 
205
                      KEY_PART_INFO *min_max_arg_part_arg,
212
206
                      uint32_t group_prefix_len_arg, 
213
207
                      uint32_t used_key_parts_arg,
214
208
                      uint32_t group_key_parts_arg, 
215
 
                      KeyInfo *index_info_arg,
 
209
                      KEY *index_info_arg,
216
210
                      uint32_t index_arg, 
217
211
                      uint32_t key_infix_len_arg,
218
212
                      unsigned char *key_infix_arg,