~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.h

Merge Stewart's dead code removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
#include <vector>
35
35
 
36
 
namespace drizzled
37
 
{
38
36
 
39
37
class select_result;
40
38
 
45
43
/* PREV_BITS only used in sql_select.cc */
46
44
#define PREV_BITS(type,A)       ((type) (((type) 1 << (A)) -1))
47
45
 
 
46
#include <plugin/myisam/myisam.h>
 
47
#include <drizzled/sql_array.h>
 
48
 
48
49
/* Values in optimize */
49
50
#define KEY_OPTIMIZE_EXISTS             1
50
51
#define KEY_OPTIMIZE_REF_OR_NULL        2
65
66
  List<Item> *fields;
66
67
} ROLLUP;
67
68
 
68
 
} /* namespace drizzled */
69
 
 
70
 
/** @TODO why is this in the middle of the file??? */
71
 
 
72
69
#include "drizzled/join.h"
73
70
 
74
 
namespace drizzled
75
 
{
76
 
 
77
71
/*****************************************************************************
78
72
  Make som simple condition optimization:
79
73
  If there is a test 'field = const' change all refs to 'field' to 'const'
144
138
                               List<Item> &res_all_fields,
145
139
                               uint32_t elements,
146
140
                                                 List<Item> &all_fields);
 
141
void select_describe(JOIN *join, bool need_tmp_table,bool need_order, bool distinct, const char *message= NULL);
147
142
bool change_group_ref(Session *session, Item_func *expr, order_st *group_list, bool *changed);
148
143
bool check_interleaving_with_nj(JoinTable *last, JoinTable *next);
149
144
 
150
 
int join_read_const_table(JoinTable *tab, optimizer::Position *pos);
 
145
int join_read_const_table(JoinTable *tab, drizzled::optimizer::Position *pos);
151
146
int join_read_system(JoinTable *tab);
152
147
int join_read_const(JoinTable *tab);
153
148
int join_read_key(JoinTable *tab);
171
166
 
172
167
void calc_used_field_length(Session *, JoinTable *join_tab);
173
168
StoredKey *get_store_key(Session *session, 
174
 
                         optimizer::KeyUse *keyuse,
 
169
                         drizzled::optimizer::KeyUse *keyuse,
175
170
                         table_map used_tables,
176
171
                         KEY_PART_INFO *key_part,
177
172
                         unsigned char *key_buff,
178
173
                         uint32_t maybe_null);
179
 
int join_tab_cmp(const void* ptr1, const void* ptr2);
180
 
int join_tab_cmp_straight(const void* ptr1, const void* ptr2);
 
174
extern "C" int join_tab_cmp(const void* ptr1, const void* ptr2);
 
175
extern "C" int join_tab_cmp_straight(const void* ptr1, const void* ptr2);
181
176
void push_index_cond(JoinTable *tab, uint32_t keyno, bool other_tbls_ok);
182
177
void add_not_null_conds(JOIN *join);
183
178
uint32_t max_part_bit(key_part_map bits);
189
184
                                List<Item> &all_fields,
190
185
                                bool *all_order_by_fields_used);
191
186
bool eq_ref_table(JOIN *join, order_st *start_order, JoinTable *tab);
 
187
int join_tab_cmp(const void* ptr1, const void* ptr2);
192
188
int remove_dup_with_compare(Session *session, Table *table, Field **first_field, uint32_t offset, Item *having);
193
189
int remove_dup_with_hash_index(Session *session, 
194
190
                               Table *table,
204
200
                         COND_EQUAL *,
205
201
                         table_map normal_tables,
206
202
                         Select_Lex *select_lex,
207
 
                         std::vector<optimizer::SargableParam> &sargables);
208
 
ha_rows get_quick_record_count(Session *session, optimizer::SqlSelect *select, Table *table, const key_map *keys,ha_rows limit);
 
203
                         std::vector<drizzled::optimizer::SargableParam> &sargables);
 
204
ha_rows get_quick_record_count(Session *session, SQL_SELECT *select, Table *table, const key_map *keys,ha_rows limit);
209
205
void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array);
210
206
void add_group_and_distinct_keys(JOIN *join, JoinTable *join_tab);
211
207
void read_cached_record(JoinTable *tab);
212
 
bool mysql_select(Session *session, Item ***rref_pointer_array,
213
 
                  TableList *tables, uint32_t wild_num,  List<Item> &list,
214
 
                  COND *conds, uint32_t og_num, order_st *order, order_st *group,
215
 
                  Item *having, uint64_t select_type,
216
 
                  select_result *result, Select_Lex_Unit *unit,
217
 
                  Select_Lex *select_lex);
218
208
// Create list for using with tempory table
219
209
void init_tmptable_sum_functions(Item_sum **func);
220
210
void update_tmptable_sum_func(Item_sum **func,Table *tmp_table);
221
211
bool only_eq_ref_tables(JOIN *join, order_st *order, table_map tables);
222
212
bool create_ref_for_key(JOIN *join, JoinTable *j, 
223
 
                        optimizer::KeyUse *org_keyuse, 
 
213
                        drizzled::optimizer::KeyUse *org_keyuse, 
224
214
                        table_map used_tables);
225
215
 
226
 
} /* namespace drizzled */
 
216
/* functions from opt_sum.cc */
 
217
bool simple_pred(Item_func *func_item, Item **args, bool *inv_order);
 
218
int opt_sum_query(TableList *tables, List<Item> &all_fields,COND *conds);
227
219
 
228
 
/** @TODO why is this in the middle of the file??? */
 
220
/* from sql_delete.cc, used by opt_range.cc */
 
221
extern "C" int refpos_order_cmp(void* arg, const void *a,const void *b);
229
222
 
230
223
#include "drizzled/stored_key.h"
231
224
 
232
 
namespace drizzled
233
 
{
234
 
 
235
225
bool cp_buffer_from_ref(Session *session, table_reference_st *ref);
236
226
int safe_index_read(JoinTable *tab);
237
227
COND *remove_eq_conds(Session *session, COND *cond, Item::cond_result *cond_value);
240
230
void print_join(Session *session, String *str,
241
231
                List<TableList> *tables, enum_query_type);
242
232
 
243
 
} /* namespace drizzled */
244
 
 
245
233
#endif /* DRIZZLED_SQL_SELECT_H */