~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to drizzled/sql_select.h

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-10-02 14:17:48 UTC
  • mfrom: (1.1.1 upstream)
  • mto: (2.1.17 sid)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20101002141748-m6vbfbfjhrw1153e
Tags: 2010.09.1802-1
* New upstream release.
* Removed pid-file argument hack.
* Updated GPL-2 address to be new address.
* Directly copy in drizzledump.1 since debian doesn't have sphinx 1.0 yet.
* Link to jquery from libjs-jquery. Add it as a depend.
* Add drizzled.8 symlink to the install files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#define KEY_OPTIMIZE_EXISTS             1
50
50
#define KEY_OPTIMIZE_REF_OR_NULL        2
51
51
 
52
 
class JOIN;
 
52
class Join;
53
53
 
54
 
enum_nested_loop_state sub_select_cache(JOIN *join, JoinTable *join_tab, bool end_of_records);
55
 
enum_nested_loop_state sub_select(JOIN *join,JoinTable *join_tab, bool end_of_records);
56
 
enum_nested_loop_state end_send_group(JOIN *join, JoinTable *join_tab, bool end_of_records);
57
 
enum_nested_loop_state end_write_group(JOIN *join, JoinTable *join_tab, bool end_of_records);
 
54
enum_nested_loop_state sub_select_cache(Join *join, JoinTable *join_tab, bool end_of_records);
 
55
enum_nested_loop_state sub_select(Join *join,JoinTable *join_tab, bool end_of_records);
 
56
enum_nested_loop_state end_send_group(Join *join, JoinTable *join_tab, bool end_of_records);
 
57
enum_nested_loop_state end_write_group(Join *join, JoinTable *join_tab, bool end_of_records);
58
58
 
59
59
typedef struct st_rollup
60
60
{
88
88
  COND_CMP(Item *a,Item_func *b) :and_level(a),cmp_func(b) {}
89
89
};
90
90
 
91
 
void TEST_join(JOIN *join);
 
91
void TEST_join(Join *join);
92
92
 
93
93
/* Extern functions in sql_select.cc */
94
94
bool store_val_in_field(Field *field, Item *val, enum_check_fields check_flag);
96
96
                        order_st *group, bool distinct, bool save_sum_fields,
97
97
                        uint64_t select_options, ha_rows rows_limit,
98
98
                        const char* alias);
99
 
void free_tmp_table(Session *session, Table *entry);
100
99
void count_field_types(Select_Lex *select_lex, Tmp_Table_Param *param,
101
100
                       List<Item> &fields, bool reset_with_sum_func);
102
101
bool setup_copy_fields(Session *session, Tmp_Table_Param *param,
109
108
                                   const char *name, Table *table,
110
109
                                   Item_field *item, uint32_t convert_blob_length);
111
110
bool test_if_ref(Item_field *left_item,Item *right_item);
112
 
COND *optimize_cond(JOIN *join, COND *conds, List<TableList> *join_list, Item::cond_result *cond_value);
 
111
COND *optimize_cond(Join *join, COND *conds, List<TableList> *join_list, Item::cond_result *cond_value);
113
112
COND *make_cond_for_table(COND *cond,table_map table, table_map used_table, bool exclude_expensive_cond);
114
113
COND* substitute_for_best_equal_field(COND *cond, COND_EQUAL *cond_equal, void *table_join_idx);
115
114
bool list_contains_unique_index(Table *table, bool (*find_func) (Field *, void *), void *data);
129
128
                                                List<Item> &res_all_fields,
130
129
                                                uint32_t elements,
131
130
                              List<Item> &all_fields);
132
 
int do_select(JOIN *join, List<Item> *fields, Table *tmp_table);
 
131
int do_select(Join *join, List<Item> *fields, Table *tmp_table);
133
132
bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
134
 
int create_sort_index(Session *session, JOIN *join, order_st *order, ha_rows filesort_limit, ha_rows select_limit, bool is_order_by);
 
133
int create_sort_index(Session *session, Join *join, order_st *order, ha_rows filesort_limit, ha_rows select_limit, bool is_order_by);
135
134
void save_index_subquery_explain_info(JoinTable *join_tab, Item* where);
136
135
Item *remove_additional_cond(Item* conds);
137
136
bool setup_sum_funcs(Session *session, Item_sum **func_ptr);
145
144
                               uint32_t elements,
146
145
                                                 List<Item> &all_fields);
147
146
bool change_group_ref(Session *session, Item_func *expr, order_st *group_list, bool *changed);
148
 
bool check_interleaving_with_nj(JoinTable *last, JoinTable *next);
 
147
bool check_interleaving_with_nj(JoinTable *next);
149
148
 
150
149
int join_read_const_table(JoinTable *tab, optimizer::Position *pos);
151
150
int join_read_system(JoinTable *tab);
153
152
int join_read_key(JoinTable *tab);
154
153
int join_read_always_key(JoinTable *tab);
155
154
int join_read_last_key(JoinTable *tab);
156
 
int join_no_more_records(READ_RECORD *info);
157
 
int join_read_next(READ_RECORD *info);
158
 
int join_read_next_different(READ_RECORD *info);
 
155
int join_no_more_records(ReadRecord *info);
 
156
int join_read_next(ReadRecord *info);
 
157
int join_read_next_different(ReadRecord *info);
159
158
int join_init_quick_read_record(JoinTable *tab);
160
159
int init_read_record_seq(JoinTable *tab);
161
160
int test_if_quick_select(JoinTable *tab);
162
161
int join_init_read_record(JoinTable *tab);
163
162
int join_read_first(JoinTable *tab);
164
 
int join_read_next_same(READ_RECORD *info);
165
 
int join_read_next_same_diff(READ_RECORD *info);
 
163
int join_read_next_same(ReadRecord *info);
 
164
int join_read_next_same_diff(ReadRecord *info);
166
165
int join_read_last(JoinTable *tab);
167
 
int join_read_prev_same(READ_RECORD *info);
168
 
int join_read_prev(READ_RECORD *info);
 
166
int join_read_prev_same(ReadRecord *info);
 
167
int join_read_prev(ReadRecord *info);
169
168
int join_read_always_key_or_null(JoinTable *tab);
170
 
int join_read_next_same_or_null(READ_RECORD *info);
 
169
int join_read_next_same_or_null(ReadRecord *info);
171
170
 
172
171
void calc_used_field_length(Session *, JoinTable *join_tab);
173
172
StoredKey *get_store_key(Session *session, 
174
173
                         optimizer::KeyUse *keyuse,
175
174
                         table_map used_tables,
176
 
                         KEY_PART_INFO *key_part,
 
175
                         KeyPartInfo *key_part,
177
176
                         unsigned char *key_buff,
178
177
                         uint32_t maybe_null);
179
178
int join_tab_cmp(const void* ptr1, const void* ptr2);
180
179
int join_tab_cmp_straight(const void* ptr1, const void* ptr2);
181
180
void push_index_cond(JoinTable *tab, uint32_t keyno, bool other_tbls_ok);
182
 
void add_not_null_conds(JOIN *join);
 
181
void add_not_null_conds(Join *join);
183
182
uint32_t max_part_bit(key_part_map bits);
184
183
COND *add_found_match_trig_cond(JoinTable *tab, COND *cond, JoinTable *root_tab);
185
184
order_st *create_distinct_group(Session *session,
188
187
                                List<Item> &fields,
189
188
                                List<Item> &all_fields,
190
189
                                bool *all_order_by_fields_used);
191
 
bool eq_ref_table(JOIN *join, order_st *start_order, JoinTable *tab);
 
190
bool eq_ref_table(Join *join, order_st *start_order, JoinTable *tab);
192
191
int remove_dup_with_compare(Session *session, Table *table, Field **first_field, uint32_t offset, Item *having);
193
192
int remove_dup_with_hash_index(Session *session, 
194
193
                               Table *table,
206
205
                         Select_Lex *select_lex,
207
206
                         std::vector<optimizer::SargableParam> &sargables);
208
207
ha_rows get_quick_record_count(Session *session, optimizer::SqlSelect *select, Table *table, const key_map *keys,ha_rows limit);
209
 
void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array);
210
 
void add_group_and_distinct_keys(JOIN *join, JoinTable *join_tab);
 
208
void optimize_keyuse(Join *join, DYNAMIC_ARRAY *keyuse_array);
 
209
void add_group_and_distinct_keys(Join *join, JoinTable *join_tab);
211
210
void read_cached_record(JoinTable *tab);
212
211
bool mysql_select(Session *session, Item ***rref_pointer_array,
213
212
                  TableList *tables, uint32_t wild_num,  List<Item> &list,
218
217
// Create list for using with tempory table
219
218
void init_tmptable_sum_functions(Item_sum **func);
220
219
void update_tmptable_sum_func(Item_sum **func,Table *tmp_table);
221
 
bool only_eq_ref_tables(JOIN *join, order_st *order, table_map tables);
222
 
bool create_ref_for_key(JOIN *join, JoinTable *j, 
 
220
bool only_eq_ref_tables(Join *join, order_st *order, table_map tables);
 
221
bool create_ref_for_key(Join *join, JoinTable *j, 
223
222
                        optimizer::KeyUse *org_keyuse, 
224
223
                        table_map used_tables);
225
224