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);
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);
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,
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);
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);
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);
230
223
#include "drizzled/stored_key.h"
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);