~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_select.h

Merged in latest plugin-slot-reorg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include "drizzled/field/varstring.h"
26
26
#include "drizzled/item/null.h"
27
27
#include <drizzled/enum_nested_loop_state.h>
28
 
#include <drizzled/optimizer/position.h>
29
 
#include <drizzled/optimizer/sargable_param.h>
 
28
#include "drizzled/optimizer/position.h"
 
29
#include "drizzled/optimizer/sargable_param.h"
 
30
#include "drizzled/optimizer/key_use.h"
30
31
#include "drizzled/join_cache.h"
31
32
#include "drizzled/join_table.h"
32
33
 
49
50
#define KEY_OPTIMIZE_EXISTS             1
50
51
#define KEY_OPTIMIZE_REF_OR_NULL        2
51
52
 
52
 
class KeyUse 
53
 
{
54
 
public:
55
 
  Table *table; /**< Pointer to the table this key belongs to */
56
 
  Item *val;    /**< or value if no field */
57
 
  table_map used_tables;
58
 
  uint32_t key;
59
 
  uint32_t keypart;
60
 
  uint32_t optimize; /**< 0, or KEY_OPTIMIZE_* */
61
 
  key_part_map keypart_map;
62
 
  ha_rows ref_table_rows;
63
 
  /**
64
 
    If true, the comparison this value was created from will not be
65
 
    satisfied if val has NULL 'value'.
66
 
  */
67
 
  bool null_rejecting;
68
 
  /**
69
 
    !NULL - This KeyUse was created from an equality that was wrapped into
70
 
            an Item_func_trig_cond. This means the equality (and validity of
71
 
            this KeyUse element) can be turned on and off. The on/off state
72
 
            is indicted by the pointed value:
73
 
              *cond_guard == true <=> equality condition is on
74
 
              *cond_guard == false <=> equality condition is off
75
 
 
76
 
    NULL  - Otherwise (the source equality can't be turned off)
77
 
  */
78
 
  bool *cond_guard;
79
 
};
80
 
 
81
53
class JOIN;
82
54
 
83
55
enum_nested_loop_state sub_select_cache(JOIN *join, JoinTable *join_tab, bool end_of_records);
194
166
 
195
167
void calc_used_field_length(Session *, JoinTable *join_tab);
196
168
StoredKey *get_store_key(Session *session, 
197
 
                         KeyUse *keyuse,
 
169
                         drizzled::optimizer::KeyUse *keyuse,
198
170
                         table_map used_tables,
199
171
                         KEY_PART_INFO *key_part,
200
172
                         unsigned char *key_buff,
237
209
void init_tmptable_sum_functions(Item_sum **func);
238
210
void update_tmptable_sum_func(Item_sum **func,Table *tmp_table);
239
211
bool only_eq_ref_tables(JOIN *join, order_st *order, table_map tables);
240
 
bool create_ref_for_key(JOIN *join, JoinTable *j, KeyUse *org_keyuse, table_map used_tables);
 
212
bool create_ref_for_key(JOIN *join, JoinTable *j, 
 
213
                        drizzled::optimizer::KeyUse *org_keyuse, 
 
214
                        table_map used_tables);
241
215
 
242
216
/* functions from opt_sum.cc */
243
217
bool simple_pred(Item_func *func_item, Item **args, bool *inv_order);