257
257
* check_transactional_lock() too.
259
259
bool placeholder();
261
* Print table as it should be in join list.
263
* @param str string where table should be printed
260
265
void print(Session *session, String *str, enum_query_type query_type);
267
* Sets insert_values buffer
269
* @param[in] memory pool for allocating
274
* true - out of memory
261
276
bool set_insert_values(MEM_ROOT *mem_root);
278
* Find underlying base tables (TableList) which represent given
279
* table_to_find (Table)
281
* @param[in] table to find
284
* NULL if table is not found
286
* Pointer to found table reference
262
288
TableList *find_underlying_table(Table *table);
290
* Retrieve the first (left-most) leaf in a nested join tree with
291
* respect to name resolution.
295
* Given that 'this' is a nested table reference, recursively walk
296
* down the left-most children of 'this' until we reach a leaf
297
* table reference with respect to name resolution.
300
* If 'this' is a nested table reference - the left-most child of
301
* the tree rooted in 'this',
263
304
TableList *first_leaf_for_name_resolution();
306
* Retrieve the last (right-most) leaf in a nested join tree with
307
* respect to name resolution.
311
* Given that 'this' is a nested table reference, recursively walk
312
* down the right-most children of 'this' until we reach a leaf
313
* table reference with respect to name resolution.
316
* If 'this' is a nested table reference - the right-most child of
317
* the tree rooted in 'this',
264
320
TableList *last_leaf_for_name_resolution();
322
* Test if this is a leaf with respect to name resolution.
326
* A table reference is a leaf with respect to name resolution if
327
* it is either a leaf node in a nested join tree (table, view,
328
* schema table, subquery), or an inner node that represents a
329
* NATURAL/USING join, or a nested join with materialized join
333
* true if a leaf, false otherwise.
265
335
bool is_leaf_for_name_resolution();
266
336
inline TableList *top_table()
340
* Return subselect that contains the FROM list this table is taken from
343
* Subselect item for the subquery that contains the FROM list
344
* this table is taken from if there is any
269
348
Item_subselect *containing_subselect();
272
351
* Compiles the tagged hints list and fills up st_table::keys_in_use_for_query,
273
352
* st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by,
274
353
* st_table::force_index and st_table::covering_keys.
355
* @param the Table to operate on.
359
* The parser collects the index hints for each table in a "tagged list"
360
* (TableList::index_hints). Using the information in this tagged list
361
* this function sets the members Table::keys_in_use_for_query,
362
* Table::keys_in_use_for_group_by, Table::keys_in_use_for_order_by,
363
* Table::force_index and Table::covering_keys.
365
* Current implementation of the runtime does not allow mixing FORCE INDEX
366
* and USE INDEX, so this is checked here. Then the FORCE INDEX list
367
* (if non-empty) is appended to the USE INDEX list and a flag is set.
369
* Multiple hints of the same kind are processed so that each clause
370
* is applied to what is computed in the previous clause.
373
* USE INDEX (i1) USE INDEX (i2)
376
* and means "consider only i1 and i2".
379
* USE INDEX () USE INDEX (i1)
382
* and means "consider only the index i1"
384
* It is OK to have the same index several times, e.g. "USE INDEX (i1,i1)" is
387
* Different kind of hints (USE/FORCE/IGNORE) are processed in the following
389
* 1. All indexes in USE (or FORCE) INDEX are added to the mask.
390
* 2. All IGNORE INDEX
391
* e.g. "USE INDEX i1, IGNORE INDEX i1, USE INDEX i1" will not use i1 at all
392
* as if we had "USE INDEX i1, USE INDEX i1, IGNORE INDEX i1".
393
* As an optimization if there is a covering index, and we have
394
* IGNORE INDEX FOR GROUP/order_st, and this index is used for the JOIN part,
395
* then we have to ignore the IGNORE INDEX FROM GROUP/order_st.
398
* false no errors found
400
* true found and reported an error.
276
402
bool process_index_hints(Table *table);
404
* Creates a table definition cache key for this table entry.
406
* @param[out] Create key here (must be of size MAX_DBKEY_LENGTH)
410
* The table cache_key is created from:
414
* if the table is a tmp table, we add the following to make each tmp table
415
* unique on the slave:
417
* 4 bytes for master thread id
418
* 4 bytes pseudo thread id
277
423
uint32_t create_table_def_key(char *key);