~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.h

modifying folder structure

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
 
4
 *  Copyright (C) 2008-2009 Sun Microsystems, Inc.
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
56
56
enum_nested_loop_state end_send_group(Join *join, JoinTable *join_tab, bool end_of_records);
57
57
enum_nested_loop_state end_write_group(Join *join, JoinTable *join_tab, bool end_of_records);
58
58
 
59
 
typedef struct st_rollup
 
59
class Rollup
60
60
{
 
61
public:
61
62
  enum State { STATE_NONE, STATE_INITED, STATE_READY };
 
63
 
 
64
  Rollup()
 
65
  :
 
66
  state(),
 
67
  null_items(NULL),
 
68
  ref_pointer_arrays(NULL),
 
69
  fields()
 
70
  {}
 
71
  
 
72
  Rollup(State in_state,
 
73
         Item_null_result **in_null_items,
 
74
         Item ***in_ref_pointer_arrays,
 
75
         List<Item> *in_fields)
 
76
  :
 
77
  state(in_state),
 
78
  null_items(in_null_items),
 
79
  ref_pointer_arrays(in_ref_pointer_arrays),
 
80
  fields(in_fields)
 
81
  {}
 
82
  
 
83
  State getState() const
 
84
  {
 
85
    return state;
 
86
  }
 
87
 
 
88
  void setState(State in_state)
 
89
  {
 
90
    state= in_state;
 
91
  }
 
92
 
 
93
  Item_null_result **getNullItems() const
 
94
  {
 
95
    return null_items;
 
96
  }
 
97
 
 
98
  void setNullItems(Item_null_result **in_null_items)
 
99
  {
 
100
    null_items= in_null_items;
 
101
  }
 
102
 
 
103
  Item ***getRefPointerArrays() const
 
104
  {
 
105
    return ref_pointer_arrays;
 
106
  }
 
107
 
 
108
  void setRefPointerArrays(Item ***in_ref_pointer_arrays)
 
109
  {
 
110
    ref_pointer_arrays= in_ref_pointer_arrays;
 
111
  }
 
112
 
 
113
  List<Item> *getFields() const
 
114
  {
 
115
    return fields;
 
116
  }
 
117
 
 
118
  void setFields(List<Item> *in_fields)
 
119
  {
 
120
    fields= in_fields;
 
121
  }
 
122
  
 
123
private:
62
124
  State state;
63
125
  Item_null_result **null_items;
64
126
  Item ***ref_pointer_arrays;
65
127
  List<Item> *fields;
66
 
} ROLLUP;
 
128
};
67
129
 
68
130
} /* namespace drizzled */
69
131
 
82
144
  item->marker should be 0 for all items on entry
83
145
  Return in cond_value false if condition is impossible (1 = 2)
84
146
*****************************************************************************/
85
 
struct COND_CMP {
86
 
  Item *and_level;
87
 
  Item_func *cmp_func;
88
 
  COND_CMP(Item *a,Item_func *b) :and_level(a),cmp_func(b) {}
89
 
};
 
147
typedef std::pair<Item*, Item_func*> COND_CMP;
90
148
 
91
149
void TEST_join(Join *join);
92
150
 
181
239
void add_not_null_conds(Join *join);
182
240
uint32_t max_part_bit(key_part_map bits);
183
241
COND *add_found_match_trig_cond(JoinTable *tab, COND *cond, JoinTable *root_tab);
184
 
Order *create_distinct_group(Session *session,
185
 
                                Item **ref_pointer_array,
186
 
                                Order *order,
187
 
                                List<Item> &fields,
188
 
                                List<Item> &all_fields,
189
 
                                bool *all_order_by_fields_used);
190
242
bool eq_ref_table(Join *join, Order *start_order, JoinTable *tab);
191
243
int remove_dup_with_compare(Session *session, Table *table, Field **first_field, uint32_t offset, Item *having);
192
244
int remove_dup_with_hash_index(Session *session, 
208
260
void optimize_keyuse(Join *join, DYNAMIC_ARRAY *keyuse_array);
209
261
void add_group_and_distinct_keys(Join *join, JoinTable *join_tab);
210
262
void read_cached_record(JoinTable *tab);
211
 
bool mysql_select(Session *session, Item ***rref_pointer_array,
 
263
bool select_query(Session *session, Item ***rref_pointer_array,
212
264
                  TableList *tables, uint32_t wild_num,  List<Item> &list,
213
265
                  COND *conds, uint32_t og_num, Order *order, Order *group,
214
266
                  Item *having, uint64_t select_type,