~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table_list.h

  • Committer: Monty Taylor
  • Date: 2008-12-08 01:15:27 UTC
  • mto: This revision was merged to the branch mainline in revision 670.
  • Revision ID: monty@inaugust.com-20081208011527-lq9m47jsmiiqn999
Replaced my hacked up m4/ac_system_extensions.m4 with the one from gnulib.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
19
 */
20
20
 
 
21
 
21
22
#ifndef DRIZZLED_TABLE_LIST_H
22
23
#define DRIZZLED_TABLE_LIST_H
23
24
 
 
25
/*
 
26
  Table reference in the FROM clause.
 
27
 
 
28
  These table references can be of several types that correspond to
 
29
  different SQL elements. Below we list all types of TableLists with
 
30
  the necessary conditions to determine when a TableList instance
 
31
  belongs to a certain type.
 
32
 
 
33
  1) table (TableList::view == NULL)
 
34
     - base table
 
35
       (TableList::derived == NULL)
 
36
     - subquery - TableList::table is a temp table
 
37
       (TableList::derived != NULL)
 
38
     - information schema table
 
39
       (TableList::schema_table != NULL)
 
40
       NOTICE: for schema tables TableList::field_translation may be != NULL
 
41
  2) view (TableList::view != NULL)
 
42
     - merge    (TableList::effective_algorithm == VIEW_ALGORITHM_MERGE)
 
43
           also (TableList::field_translation != NULL)
 
44
     - tmptable (TableList::effective_algorithm == VIEW_ALGORITHM_TMPTABLE)
 
45
           also (TableList::field_translation == NULL)
 
46
  3) nested table reference (TableList::nested_join != NULL)
 
47
     - table sequence - e.g. (t1, t2, t3)
 
48
       TODO: how to distinguish from a JOIN?
 
49
     - general JOIN
 
50
       TODO: how to distinguish from a table sequence?
 
51
     - NATURAL JOIN
 
52
       (TableList::natural_join != NULL)
 
53
       - JOIN ... USING
 
54
         (TableList::join_using_fields != NULL)
 
55
     - semi-join
 
56
       ;
 
57
*/
 
58
 
 
59
 
24
60
#include <drizzled/table.h>
25
61
 
26
 
namespace drizzled
27
 
{
28
 
 
29
62
class Index_hint;
30
63
class COND_EQUAL;
31
64
class Natural_join_column;
32
65
class select_union;
33
 
class Select_Lex_Unit;
34
 
class Select_Lex;
35
 
class Tmp_Table_Param;
 
66
class st_select_lex_unit;
 
67
class ST_SCHEMA_TABLE;
 
68
class st_select_lex;
 
69
class TMP_TABLE_PARAM;
 
70
class Field_translator;
36
71
class Item_subselect;
37
72
class Table;
38
73
 
39
 
namespace plugin
40
 
{
41
 
  class StorageEngine;
42
 
}
43
 
 
44
74
struct nested_join_st;
45
75
 
46
 
/**
47
 
 * A Table referenced in the FROM clause.
48
 
 *
49
 
 * These table references can be of several types that correspond to
50
 
 * different SQL elements. Below we list all types of TableLists with
51
 
 * the necessary conditions to determine when a TableList instance
52
 
 * belongs to a certain type.
53
 
 *
54
 
 * 1) table (TableList::view == NULL)
55
 
 *    - base table
56
 
 *    (TableList::derived == NULL)
57
 
 *    - subquery - TableList::table is a temp table
58
 
 *    (TableList::derived != NULL)
59
 
 *    
60
 
 *    @note
61
 
 *
62
 
 *    for schema tables TableList::field_translation may be != NULL
63
 
 *
64
 
 * 2) Was VIEW 
65
 
 * 3) nested table reference (TableList::nested_join != NULL)
66
 
 *     - table sequence - e.g. (t1, t2, t3)
67
 
 *     @todo how to distinguish from a JOIN?
68
 
 *     - general JOIN
69
 
 *     @todo how to distinguish from a table sequence?
70
 
 *     - NATURAL JOIN
71
 
 *     (TableList::natural_join != NULL)
72
 
 *     - JOIN ... USING
73
 
 *     (TableList::join_using_fields != NULL)
74
 
 *     - semi-join
75
 
 */
76
76
class TableList
77
77
{
78
78
public:
79
 
  TableList():
80
 
    next_local(NULL),
81
 
    next_global(NULL),
82
 
    prev_global(NULL),
83
 
    db(NULL),
84
 
    alias(NULL),
85
 
    table_name(NULL),
86
 
    option(NULL),
87
 
    on_expr(NULL),
88
 
    table(NULL),
89
 
    prep_on_expr(NULL),
90
 
    cond_equal(NULL),
91
 
    natural_join(NULL),
92
 
    is_natural_join(false),
93
 
    is_join_columns_complete(false),
94
 
    straight(false),
95
 
    force_index(false),
96
 
    ignore_leaves(false),
97
 
    create(false),
98
 
    join_using_fields(NULL),
99
 
    join_columns(NULL),
100
 
    next_name_resolution_table(NULL),
101
 
    index_hints(NULL),
102
 
    derived_result(NULL),
103
 
    derived(NULL),
104
 
    schema_select_lex(NULL),
105
 
    select_lex(NULL),
106
 
    next_leaf(NULL),
107
 
    outer_join(0),
108
 
    shared(0),
109
 
    i_s_requested_object(0),
110
 
    db_length(0),
111
 
    table_name_length(0),
112
 
    dep_tables(0),
113
 
    on_expr_dep_tables(0),
114
 
    nested_join(NULL),
115
 
    embedding(NULL),
116
 
    join_list(NULL),
117
 
    db_type(NULL),
118
 
    internal_tmp_table(false),
119
 
    is_alias(false),
120
 
    is_fqtn(false),
121
 
    has_db_lookup_value(false),
122
 
    has_table_lookup_value(false)
123
 
  {}
 
79
  TableList() {}                          /* Remove gcc warning */
124
80
 
125
81
  /**
126
 
   * List of tables local to a subquery (used by SQL_LIST). Considers
127
 
   * views as leaves (unlike 'next_leaf' below). Created at parse time
128
 
   * in Select_Lex::add_table_to_list() -> table_list.link_in_list().
129
 
   */
 
82
    Prepare TableList that consists of one table instance to use in
 
83
    simple_open_and_lock_tables
 
84
  */
 
85
  inline void init_one_table(const char *db_name_arg,
 
86
                             const char *table_name_arg,
 
87
                             enum thr_lock_type lock_type_arg)
 
88
  {
 
89
    memset(this, 0, sizeof(*this));
 
90
    db= (char*) db_name_arg;
 
91
    table_name= alias= (char*) table_name_arg;
 
92
    lock_type= lock_type_arg;
 
93
  }
 
94
 
 
95
  /*
 
96
    List of tables local to a subquery (used by SQL_LIST). Considers
 
97
    views as leaves (unlike 'next_leaf' below). Created at parse time
 
98
    in st_select_lex::add_table_to_list() -> table_list.link_in_list().
 
99
  */
130
100
  TableList *next_local;
131
 
 
132
 
  /** link in a global list of all queries tables */
133
 
  TableList *next_global; 
134
 
  TableList **prev_global;
135
 
 
136
 
  char *db;
137
 
  const char *alias;
138
 
  char *table_name;
139
 
  char *option; ///< Used by cache index
140
 
  Item *on_expr; ///< Used with outer join
141
 
  Table *table; ///< opened table
142
 
  /**
143
 
   * The structure of ON expression presented in the member above
144
 
   * can be changed during certain optimizations. This member
145
 
   * contains a snapshot of AND-OR structure of the ON expression
146
 
   * made after permanent transformations of the parse tree, and is
147
 
   * used to restore ON clause before every reexecution of a prepared
148
 
   * statement or stored procedure.
149
 
   */
150
 
  Item *prep_on_expr;
151
 
  COND_EQUAL *cond_equal; ///< Used with outer join
152
 
  /**
153
 
   * During parsing - left operand of NATURAL/USING join where 'this' is
154
 
   * the right operand. After parsing (this->natural_join == this) iff
155
 
   * 'this' represents a NATURAL or USING join operation. Thus after
156
 
   * parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
157
 
   */
 
101
  /* link in a global list of all queries tables */
 
102
  TableList *next_global, **prev_global;
 
103
  char          *db, *alias, *table_name, *schema_table_name;
 
104
  char          *option;                /* Used by cache index  */
 
105
  Item          *on_expr;               /* Used with outer join */
 
106
  Item          *sj_on_expr;
 
107
  /*
 
108
    (Valid only for semi-join nests) Bitmap of tables that are within the
 
109
    semi-join (this is different from bitmap of all nest's children because
 
110
    tables that were pulled out of the semi-join nest remain listed as
 
111
    nest's children).
 
112
  */
 
113
  table_map     sj_inner_tables;
 
114
  /* Number of IN-compared expressions */
 
115
  uint32_t          sj_in_exprs;
 
116
  /*
 
117
    The structure of ON expression presented in the member above
 
118
    can be changed during certain optimizations. This member
 
119
    contains a snapshot of AND-OR structure of the ON expression
 
120
    made after permanent transformations of the parse tree, and is
 
121
    used to restore ON clause before every reexecution of a prepared
 
122
    statement or stored procedure.
 
123
  */
 
124
  Item          *prep_on_expr;
 
125
  COND_EQUAL    *cond_equal;            /* Used with outer join */
 
126
  /*
 
127
    During parsing - left operand of NATURAL/USING join where 'this' is
 
128
    the right operand. After parsing (this->natural_join == this) iff
 
129
    'this' represents a NATURAL or USING join operation. Thus after
 
130
    parsing 'this' is a NATURAL/USING join iff (natural_join != NULL).
 
131
  */
158
132
  TableList *natural_join;
159
 
  /**
160
 
   * True if 'this' represents a nested join that is a NATURAL JOIN.
161
 
   * For one of the operands of 'this', the member 'natural_join' points
162
 
   * to the other operand of 'this'.
163
 
   */
 
133
  /*
 
134
    True if 'this' represents a nested join that is a NATURAL JOIN.
 
135
    For one of the operands of 'this', the member 'natural_join' points
 
136
    to the other operand of 'this'.
 
137
  */
164
138
  bool is_natural_join;
165
 
 
166
 
  /** true if join_columns contains all columns of this table reference. */
167
 
  bool is_join_columns_complete;
168
 
 
169
 
  bool straight; ///< optimize with prev table
170
 
  bool force_index; ///< prefer index over table scan
171
 
  bool ignore_leaves; ///< preload only non-leaf nodes
172
 
 
173
 
  /**
174
 
   * This TableList object corresponds to the table to be created
175
 
   * so it is possible that it does not exist (used in CREATE TABLE
176
 
   * ... SELECT implementation).
177
 
   */
178
 
  bool create;
179
 
 
180
 
  /** Field names in a USING clause for JOIN ... USING. */
 
139
  /* Field names in a USING clause for JOIN ... USING. */
181
140
  List<String> *join_using_fields;
182
 
  /**
183
 
   * Explicitly store the result columns of either a NATURAL/USING join or
184
 
   * an operand of such a join.
185
 
   */
 
141
  /*
 
142
    Explicitly store the result columns of either a NATURAL/USING join or
 
143
    an operand of such a join.
 
144
  */
186
145
  List<Natural_join_column> *join_columns;
 
146
  /* true if join_columns contains all columns of this table reference. */
 
147
  bool is_join_columns_complete;
187
148
 
188
 
  /**
189
 
   * List of nodes in a nested join tree, that should be considered as
190
 
   * leaves with respect to name resolution. The leaves are: views,
191
 
   * top-most nodes representing NATURAL/USING joins, subqueries, and
192
 
   * base tables. All of these TableList instances contain a
193
 
   * materialized list of columns. The list is local to a subquery.
194
 
   */
 
149
  /*
 
150
    List of nodes in a nested join tree, that should be considered as
 
151
    leaves with respect to name resolution. The leaves are: views,
 
152
    top-most nodes representing NATURAL/USING joins, subqueries, and
 
153
    base tables. All of these TableList instances contain a
 
154
    materialized list of columns. The list is local to a subquery.
 
155
  */
195
156
  TableList *next_name_resolution_table;
196
 
  /** Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
 
157
  /* Index names in a "... JOIN ... USE/IGNORE INDEX ..." clause. */
197
158
  List<Index_hint> *index_hints;
198
 
  /**
199
 
   * select_result for derived table to pass it from table creation to table
200
 
   * filling procedure
201
 
   */
202
 
  select_union *derived_result;
203
 
  Select_Lex_Unit *derived; ///< Select_Lex_Unit of derived table */
204
 
  Select_Lex *schema_select_lex;
205
 
  /** link to select_lex where this table was used */
206
 
  Select_Lex *select_lex;
207
 
  /**
208
 
   * List of all base tables local to a subquery including all view
209
 
   * tables. Unlike 'next_local', this in this list views are *not*
210
 
   * leaves. Created in setup_tables() -> make_leaves_list().
211
 
   */
212
 
  TableList *next_leaf;
 
159
  Table        *table;    /* opened table */
 
160
  uint32_t          table_id; /* table id (from binlog) for opened table */
 
161
  /*
 
162
    select_result for derived table to pass it from table creation to table
 
163
    filling procedure
 
164
  */
 
165
  select_union  *derived_result;
 
166
  /*
 
167
    Reference from aux_tables to local list entry of main select of
 
168
    multi-delete statement:
 
169
    delete t1 from t2,t1 where t1.a<'B' and t2.b=t1.b;
 
170
    here it will be reference of first occurrence of t1 to second (as you
 
171
    can see this lists can't be merged)
 
172
  */
 
173
  TableList     *correspondent_table;
 
174
  st_select_lex_unit *derived;          /* SELECT_LEX_UNIT of derived table */
 
175
  ST_SCHEMA_TABLE *schema_table;        /* Information_schema table */
 
176
  st_select_lex *schema_select_lex;
 
177
  /*
 
178
    True when the view field translation table is used to convert
 
179
    schema table fields for backwards compatibility with SHOW command.
 
180
  */
 
181
  bool schema_table_reformed;
 
182
  TMP_TABLE_PARAM *schema_table_param;
 
183
  /* link to select_lex where this table was used */
 
184
  st_select_lex *select_lex;
 
185
  Field_translator *field_translation;  /* array of VIEW fields */
 
186
  /* pointer to element after last one in translation table above */
 
187
  Field_translator *field_translation_end;
 
188
  /*
 
189
    List (based on next_local) of underlying tables of this view. I.e. it
 
190
    does not include the tables of subqueries used in the view. Is set only
 
191
    for merged views.
 
192
  */
 
193
  TableList     *merge_underlying_list;
 
194
  /*
 
195
    List of all base tables local to a subquery including all view
 
196
    tables. Unlike 'next_local', this in this list views are *not*
 
197
    leaves. Created in setup_tables() -> make_leaves_list().
 
198
  */
 
199
  TableList     *next_leaf;
213
200
  thr_lock_type lock_type;
214
 
  uint32_t outer_join; ///< Which join type
215
 
  uint32_t shared; ///<Used in multi-upd
 
201
  uint          outer_join;             /* Which join type */
 
202
  uint          shared;                 /* Used in multi-upd */
 
203
  size_t        db_length;
 
204
  size_t        table_name_length;
 
205
  bool          straight;               /* optimize with prev table */
 
206
  bool          updating;               /* for replicate-do/ignore table */
 
207
  bool          force_index;            /* prefer index over table scan */
 
208
  bool          ignore_leaves;          /* preload only non-leaf nodes */
 
209
  table_map     dep_tables;             /* tables the table depends on      */
 
210
  table_map     on_expr_dep_tables;     /* tables on expression depends on  */
 
211
  nested_join_st *nested_join;   /* if the element is a nested join  */
 
212
  TableList *embedding;             /* nested join containing the table */
 
213
  List<TableList> *join_list;/* join list the table belongs to   */
 
214
  bool          cacheable_table;        /* stop PS caching */
 
215
  handlerton    *db_type;               /* table_type for handler */
 
216
  char          timestamp_buffer[20];   /* buffer for timestamp (19+1) */
 
217
  /*
 
218
    This TableList object corresponds to the table to be created
 
219
    so it is possible that it does not exist (used in CREATE TABLE
 
220
    ... SELECT implementation).
 
221
  */
 
222
  bool          create;
 
223
  /* For transactional locking. */
 
224
  int           lock_timeout;           /* NOWAIT or WAIT [X]               */
 
225
  bool          lock_transactional;     /* If transactional lock requested. */
 
226
  bool          internal_tmp_table;
 
227
  /** true if an alias for this table was specified in the SQL. */
 
228
  bool          is_alias;
 
229
  /** true if the table is referred to in the statement using a fully
 
230
      qualified name (<db_name>.<table_name>).
 
231
  */
 
232
  bool          is_fqtn;
 
233
 
216
234
  uint32_t i_s_requested_object;
217
 
  size_t db_length;
218
 
  size_t table_name_length;
219
 
  table_map dep_tables; ///< tables the table depends on
220
 
  table_map on_expr_dep_tables; ///< tables on expression depends on
221
 
  nested_join_st *nested_join; ///< if the element is a nested join
222
 
  TableList *embedding; ///< nested join containing the table
223
 
  List<TableList> *join_list; ///< join list the table belongs to
224
 
  plugin::StorageEngine *db_type; ///< table_type for handler
225
 
  char timestamp_buffer[20]; ///< buffer for timestamp (19+1)
226
 
  bool internal_tmp_table;
227
 
  /** true if an alias for this table was specified in the SQL. */
228
 
  bool is_alias;
229
 
  /** 
230
 
   * true if the table is referred to in the statement using a fully
231
 
   * qualified name (<db_name>.<table_name>).
232
 
   */
233
 
  bool is_fqtn;
234
 
 
235
235
  bool has_db_lookup_value;
236
236
  bool has_table_lookup_value;
237
 
 
 
237
  uint32_t table_open_method;
 
238
  enum enum_schema_table_state schema_table_state;
238
239
  void set_underlying_merge();
239
240
  bool setup_underlying(Session *session);
240
 
 
241
 
  /**
242
 
   * If you change placeholder(), please check the condition in
243
 
   * check_transactional_lock() too.
244
 
   */
 
241
  void cleanup_items();
 
242
  /*
 
243
    If you change placeholder(), please check the condition in
 
244
    check_transactional_lock() too.
 
245
  */
245
246
  bool placeholder();
246
 
  /**
247
 
   * Print table as it should be in join list.
248
 
   * 
249
 
   * @param str   string where table should be printed
250
 
   */
251
247
  void print(Session *session, String *str, enum_query_type query_type);
252
 
  /**
253
 
   * Sets insert_values buffer
254
 
   *
255
 
   * @param[in] memory pool for allocating
256
 
   *
257
 
   * @retval
258
 
   *  false - OK
259
 
   * @retval
260
 
   *  true - out of memory
261
 
   */
262
 
  bool set_insert_values(memory::Root *mem_root);
263
 
  /**
264
 
   * Find underlying base tables (TableList) which represent given
265
 
   * table_to_find (Table)
266
 
   *
267
 
   * @param[in] table to find
268
 
   *
269
 
   * @retval
270
 
   *  NULL if table is not found
271
 
   * @retval
272
 
   *  Pointer to found table reference
273
 
   */
 
248
  bool set_insert_values(MEM_ROOT *mem_root);
274
249
  TableList *find_underlying_table(Table *table);
275
 
  /**
276
 
   * Retrieve the first (left-most) leaf in a nested join tree with
277
 
   * respect to name resolution.
278
 
   *
279
 
   * @details
280
 
   *
281
 
   * Given that 'this' is a nested table reference, recursively walk
282
 
   * down the left-most children of 'this' until we reach a leaf
283
 
   * table reference with respect to name resolution.
284
 
   *
285
 
   * @retval
286
 
   *  If 'this' is a nested table reference - the left-most child of
287
 
   *  the tree rooted in 'this',
288
 
   *  else return 'this'
289
 
   */
290
250
  TableList *first_leaf_for_name_resolution();
291
 
  /**
292
 
   * Retrieve the last (right-most) leaf in a nested join tree with
293
 
   * respect to name resolution.
294
 
   *
295
 
   * @details
296
 
   *
297
 
   * Given that 'this' is a nested table reference, recursively walk
298
 
   * down the right-most children of 'this' until we reach a leaf
299
 
   * table reference with respect to name resolution.
300
 
   *
301
 
   * @retval
302
 
   *  If 'this' is a nested table reference - the right-most child of
303
 
   *  the tree rooted in 'this',
304
 
   *  else 'this'
305
 
   */
306
251
  TableList *last_leaf_for_name_resolution();
307
 
  /**
308
 
   * Test if this is a leaf with respect to name resolution.
309
 
   *
310
 
   * @details
311
 
   * 
312
 
   * A table reference is a leaf with respect to name resolution if
313
 
   * it is either a leaf node in a nested join tree (table, view,
314
 
   * schema table, subquery), or an inner node that represents a
315
 
   * NATURAL/USING join, or a nested join with materialized join
316
 
   * columns.
317
 
   *
318
 
   * @retval
319
 
   *  true if a leaf, false otherwise.
320
 
   */
321
252
  bool is_leaf_for_name_resolution();
322
253
  inline TableList *top_table()
323
 
  { return this; }
 
254
    { return this; }
324
255
 
325
 
  /**
326
 
   * Return subselect that contains the FROM list this table is taken from
327
 
   *
328
 
   * @retval
329
 
   *  Subselect item for the subquery that contains the FROM list
330
 
   *  this table is taken from if there is any
331
 
   * @retval
332
 
   *  NULL otherwise
333
 
   */
 
256
  /*
 
257
    Cleanup for re-execution in a prepared statement or a stored
 
258
    procedure.
 
259
  */
 
260
  void reinit_before_use(Session *session);
334
261
  Item_subselect *containing_subselect();
335
262
 
336
 
  /**
337
 
   * Compiles the tagged hints list and fills up st_table::keys_in_use_for_query,
338
 
   * st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
339
 
   * st_table::force_index and st_table::covering_keys.
340
 
   *
341
 
   * @param the Table to operate on.
342
 
   *
343
 
   * @details
344
 
   *
345
 
   * The parser collects the index hints for each table in a "tagged list"
346
 
   * (TableList::index_hints). Using the information in this tagged list
347
 
   * this function sets the members Table::keys_in_use_for_query,
348
 
   * Table::keys_in_use_for_group_by, Table::keys_in_use_for_order_by,
349
 
   * Table::force_index and Table::covering_keys.
350
 
   *
351
 
   * Current implementation of the runtime does not allow mixing FORCE INDEX
352
 
   * and USE INDEX, so this is checked here. Then the FORCE INDEX list
353
 
   * (if non-empty) is appended to the USE INDEX list and a flag is set.
354
 
   * 
355
 
   * Multiple hints of the same kind are processed so that each clause
356
 
   * is applied to what is computed in the previous clause.
357
 
   * 
358
 
   * For example:
359
 
   *       USE INDEX (i1) USE INDEX (i2)
360
 
   *    is equivalent to
361
 
   *       USE INDEX (i1,i2)
362
 
   *    and means "consider only i1 and i2".
363
 
   *
364
 
   * Similarly
365
 
   *       USE INDEX () USE INDEX (i1)
366
 
   *    is equivalent to
367
 
   *       USE INDEX (i1)
368
 
   *    and means "consider only the index i1"
369
 
   *
370
 
   * It is OK to have the same index several times, e.g. "USE INDEX (i1,i1)" is
371
 
   * not an error.
372
 
   *
373
 
   * Different kind of hints (USE/FORCE/IGNORE) are processed in the following
374
 
   * order:
375
 
   *    1. All indexes in USE (or FORCE) INDEX are added to the mask.
376
 
   *    2. All IGNORE INDEX
377
 
   *       e.g. "USE INDEX i1, IGNORE INDEX i1, USE INDEX i1" will not use i1 at all
378
 
   *       as if we had "USE INDEX i1, USE INDEX i1, IGNORE INDEX i1".
379
 
   *       As an optimization if there is a covering index, and we have
380
 
   *       IGNORE INDEX FOR GROUP/order_st, and this index is used for the JOIN part,
381
 
   *       then we have to ignore the IGNORE INDEX FROM GROUP/order_st.
382
 
   *
383
 
   * @retval
384
 
   *   false no errors found
385
 
   * @retval
386
 
   *   true found and reported an error.
387
 
   */
 
263
  /*
 
264
    Compiles the tagged hints list and fills up st_table::keys_in_use_for_query,
 
265
    st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
 
266
    st_table::force_index and st_table::covering_keys.
 
267
  */
388
268
  bool process_index_hints(Table *table);
389
 
  /**
390
 
   * Creates a table definition cache key for this table entry.
391
 
   *
392
 
   * @param[out] Create key here (must be of size MAX_DBKEY_LENGTH)
393
 
   *
394
 
   * @note
395
 
   *
396
 
   * The table cache_key is created from:
397
 
   *   db_name + \0
398
 
   *   table_name + \0
399
 
   *
400
 
   * if the table is a tmp table, we add the following to make each tmp table
401
 
   * unique on the slave:
402
 
   *
403
 
   * 4 bytes for master thread id
404
 
   * 4 bytes pseudo thread id
405
 
   *
406
 
   * @retval
407
 
   *  Length of key
408
 
   */
409
 
  uint32_t create_table_def_key(char *key);
410
269
};
411
270
 
412
271
void close_thread_tables(Session *session);
413
272
 
414
 
} /* namespace drizzled */
415
 
 
416
273
#endif /* DRIZZLED_TABLE_LIST_H */