~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/optimizer/key_use.h

  • Committer: Padraig O'Sullivan
  • Date: 2009-09-18 01:41:11 UTC
  • mto: This revision was merged to the branch mainline in revision 1139.
  • Revision ID: osullivan.padraig@gmail.com-20090918014111-veb0qjwjom60qy4j
Made all members of the KeyUse class private and provided appropriate
accessors for these private data members.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
class KeyUse 
33
33
{
34
34
public:
 
35
 
 
36
  KeyUse()
 
37
    :
 
38
      table(NULL),
 
39
      val(NULL),
 
40
      used_tables(0),
 
41
      key(0),
 
42
      keypart(0),
 
43
      optimize(0),
 
44
      keypart_map(0),
 
45
      ref_table_rows(0),
 
46
      null_rejecting(false),
 
47
      cond_guard(NULL)
 
48
  {}
 
49
 
 
50
  KeyUse(Table *in_table,
 
51
         Item *in_val,
 
52
         table_map in_used_tables,
 
53
         uint32_t in_key,
 
54
         uint32_t in_keypart,
 
55
         uint32_t in_optimize,
 
56
         key_part_map in_keypart_map,
 
57
         ha_rows in_ref_table_rows,
 
58
         bool in_null_rejecting,
 
59
         bool *in_cond_guard)
 
60
    :
 
61
      table(in_table),
 
62
      val(in_val),
 
63
      used_tables(in_used_tables),
 
64
      key(in_key),
 
65
      keypart(in_keypart),
 
66
      optimize(in_optimize),
 
67
      keypart_map(in_keypart_map),
 
68
      ref_table_rows(in_ref_table_rows),
 
69
      null_rejecting(in_null_rejecting),
 
70
      cond_guard(in_cond_guard)
 
71
  {}
 
72
 
 
73
  Table *getTable()
 
74
  {
 
75
    return table;
 
76
  }
 
77
 
 
78
  Item *getVal()
 
79
  {
 
80
    return val;
 
81
  }
 
82
 
 
83
  table_map getUsedTables()
 
84
  {
 
85
    return used_tables;
 
86
  }
 
87
 
 
88
  uint32_t getKey() const
 
89
  {
 
90
    return key;
 
91
  }
 
92
 
 
93
  uint32_t getKeypart() const
 
94
  {
 
95
    return keypart;
 
96
  }
 
97
 
 
98
  uint32_t getOptimizeFlags() const
 
99
  {
 
100
    return optimize;
 
101
  }
 
102
 
 
103
  key_part_map getKeypartMap()
 
104
  {
 
105
    return keypart_map;
 
106
  }
 
107
 
 
108
  ha_rows getTableRows() const
 
109
  {
 
110
    return ref_table_rows;
 
111
  }
 
112
 
 
113
  void setTableRows(ha_rows input)
 
114
  {
 
115
    ref_table_rows= input;
 
116
  }
 
117
 
 
118
  bool isNullRejected() const
 
119
  {
 
120
    return null_rejecting;
 
121
  }
 
122
 
 
123
  bool *getConditionalGuard()
 
124
  {
 
125
    return cond_guard;
 
126
  }
 
127
 
 
128
private:
 
129
 
35
130
  Table *table; /**< Pointer to the table this key belongs to */
 
131
 
36
132
  Item *val;    /**< or value if no field */
 
133
 
37
134
  table_map used_tables;
 
135
 
38
136
  uint32_t key;
 
137
 
39
138
  uint32_t keypart;
 
139
 
40
140
  uint32_t optimize; /**< 0, or KEY_OPTIMIZE_* */
 
141
 
41
142
  key_part_map keypart_map;
 
143
 
42
144
  ha_rows ref_table_rows;
 
145
 
43
146
  /**
44
 
    If true, the comparison this value was created from will not be
45
 
    satisfied if val has NULL 'value'.
46
 
  */
 
147
   * If true, the comparison this value was created from will not be
 
148
   * satisfied if val has NULL 'value'.
 
149
   */
47
150
  bool null_rejecting;
 
151
 
48
152
  /**
49
 
    !NULL - This KeyUse was created from an equality that was wrapped into
50
 
            an Item_func_trig_cond. This means the equality (and validity of
51
 
            this KeyUse element) can be turned on and off. The on/off state
52
 
            is indicted by the pointed value:
53
 
              *cond_guard == true <=> equality condition is on
54
 
              *cond_guard == false <=> equality condition is off
55
 
 
56
 
    NULL  - Otherwise (the source equality can't be turned off)
 
153
   * !NULL - This KeyUse was created from an equality that was wrapped into
 
154
   *         an Item_func_trig_cond. This means the equality (and validity of
 
155
   *         this KeyUse element) can be turned on and off. The on/off state
 
156
   *         is indicted by the pointed value:
 
157
   *           *cond_guard == true <=> equality condition is on
 
158
   *           *cond_guard == false <=> equality condition is off
 
159
   *
 
160
   * NULL  - Otherwise (the source equality can't be turned off)
57
161
  */
58
162
  bool *cond_guard;
59
163
};