~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.h

  • Committer: Brian Aker
  • Date: 2011-01-12 06:45:23 UTC
  • mto: (2073.1.4 catalogs)
  • mto: This revision was merged to the branch mainline in revision 2080.
  • Revision ID: brian@tangent.org-20110112064523-rqhptaqbph22qmj1
RemoveĀ customĀ error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_SQL_SELECT_H
21
21
#define DRIZZLED_SQL_SELECT_H
22
22
 
23
 
#include <drizzled/cached_item.h>
24
 
#include <drizzled/field/varstring.h>
25
 
#include <drizzled/item/null.h>
 
23
#include "drizzled/cached_item.h"
 
24
#include "drizzled/session.h"
 
25
#include "drizzled/field/varstring.h"
 
26
#include "drizzled/item/null.h"
26
27
#include <drizzled/enum_nested_loop_state.h>
27
 
#include <drizzled/optimizer/position.h>
28
 
#include <drizzled/optimizer/sargable_param.h>
29
 
#include <drizzled/optimizer/key_use.h>
30
 
#include <drizzled/join_cache.h>
31
 
#include <drizzled/join_table.h>
32
 
#include <drizzled/records.h>
33
 
#include <drizzled/stored_key.h>
 
28
#include "drizzled/optimizer/position.h"
 
29
#include "drizzled/optimizer/sargable_param.h"
 
30
#include "drizzled/optimizer/key_use.h"
 
31
#include "drizzled/join_cache.h"
 
32
#include "drizzled/join_table.h"
34
33
 
35
34
#include <vector>
36
35
 
37
36
namespace drizzled
38
37
{
39
38
 
40
 
class Item_func;
41
 
class Select_Lex_Unit;
42
39
class select_result;
43
 
class st_dynamic_array;
44
40
 
45
41
/**
46
42
 * @file API and Classes to use when handling where clause
60
56
enum_nested_loop_state end_send_group(Join *join, JoinTable *join_tab, bool end_of_records);
61
57
enum_nested_loop_state end_write_group(Join *join, JoinTable *join_tab, bool end_of_records);
62
58
 
63
 
class Rollup
 
59
typedef struct st_rollup
64
60
{
65
 
public:
66
61
  enum State { STATE_NONE, STATE_INITED, STATE_READY };
67
 
 
68
 
  Rollup()
69
 
  :
70
 
  state(),
71
 
  null_items(NULL),
72
 
  ref_pointer_arrays(NULL),
73
 
  fields()
74
 
  {}
75
 
  
76
 
  Rollup(State in_state,
77
 
         Item_null_result **in_null_items,
78
 
         Item ***in_ref_pointer_arrays,
79
 
         List<Item> *in_fields)
80
 
  :
81
 
  state(in_state),
82
 
  null_items(in_null_items),
83
 
  ref_pointer_arrays(in_ref_pointer_arrays),
84
 
  fields(in_fields)
85
 
  {}
86
 
  
87
 
  State getState() const
88
 
  {
89
 
    return state;
90
 
  }
91
 
 
92
 
  void setState(State in_state)
93
 
  {
94
 
    state= in_state;
95
 
  }
96
 
 
97
 
  Item_null_result **getNullItems() const
98
 
  {
99
 
    return null_items;
100
 
  }
101
 
 
102
 
  void setNullItems(Item_null_result **in_null_items)
103
 
  {
104
 
    null_items= in_null_items;
105
 
  }
106
 
 
107
 
  Item ***getRefPointerArrays() const
108
 
  {
109
 
    return ref_pointer_arrays;
110
 
  }
111
 
 
112
 
  void setRefPointerArrays(Item ***in_ref_pointer_arrays)
113
 
  {
114
 
    ref_pointer_arrays= in_ref_pointer_arrays;
115
 
  }
116
 
 
117
 
  List<Item> *getFields() const
118
 
  {
119
 
    return fields;
120
 
  }
121
 
 
122
 
  void setFields(List<Item> *in_fields)
123
 
  {
124
 
    fields= in_fields;
125
 
  }
126
 
  
127
 
private:
128
62
  State state;
129
63
  Item_null_result **null_items;
130
64
  Item ***ref_pointer_arrays;
131
65
  List<Item> *fields;
132
 
};
 
66
} ROLLUP;
133
67
 
134
68
} /* namespace drizzled */
135
69
 
136
70
/** @TODO why is this in the middle of the file??? */
137
71
 
138
 
#include <drizzled/join.h>
 
72
#include "drizzled/join.h"
139
73
 
140
74
namespace drizzled
141
75
{
207
141
                                                 List<Item> &all_fields);
208
142
bool change_group_ref(Session *session, Item_func *expr, Order *group_list, bool *changed);
209
143
bool check_interleaving_with_nj(JoinTable *next);
210
 
void update_const_equal_items(COND *cond, JoinTable *tab);
 
144
 
 
145
int join_read_const_table(JoinTable *tab, optimizer::Position *pos);
 
146
int join_read_system(JoinTable *tab);
211
147
int join_read_const(JoinTable *tab);
212
148
int join_read_key(JoinTable *tab);
213
149
int join_read_always_key(JoinTable *tab);
241
177
void add_not_null_conds(Join *join);
242
178
uint32_t max_part_bit(key_part_map bits);
243
179
COND *add_found_match_trig_cond(JoinTable *tab, COND *cond, JoinTable *root_tab);
 
180
Order *create_distinct_group(Session *session,
 
181
                                Item **ref_pointer_array,
 
182
                                Order *order,
 
183
                                List<Item> &fields,
 
184
                                List<Item> &all_fields,
 
185
                                bool *all_order_by_fields_used);
244
186
bool eq_ref_table(Join *join, Order *start_order, JoinTable *tab);
245
187
int remove_dup_with_compare(Session *session, Table *table, Field **first_field, uint32_t offset, Item *having);
246
188
int remove_dup_with_hash_index(Session *session, 
276
218
                        optimizer::KeyUse *org_keyuse, 
277
219
                        table_map used_tables);
278
220
 
 
221
} /* namespace drizzled */
 
222
 
 
223
/** @TODO why is this in the middle of the file??? */
 
224
 
 
225
#include "drizzled/stored_key.h"
 
226
 
 
227
namespace drizzled
 
228
{
 
229
 
279
230
bool cp_buffer_from_ref(Session *session, table_reference_st *ref);
280
231
int safe_index_read(JoinTable *tab);
281
232
COND *remove_eq_conds(Session *session, COND *cond, Item::cond_result *cond_value);