MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TABLE Struct Reference
Inheritance diagram for TABLE:
Collaboration diagram for TABLE:

Public Member Functions

void init (THD *thd, TABLE_LIST *tl)
bool fill_item_list (List< Item > *item_list) const
void reset_item_list (List< Item > *item_list) const
void clear_column_bitmaps (void)
void prepare_for_position (void)
void mark_columns_used_by_index_no_reset (uint index, MY_BITMAP *map)
void mark_columns_used_by_index (uint index)
void mark_auto_increment_column (void)
void mark_columns_needed_for_update (void)
 Mark columns needed for doing an update of a row.
void mark_columns_needed_for_delete (void)
void mark_columns_needed_for_insert (void)
void mark_columns_per_binlog_row_image (void)
void column_bitmaps_set (MY_BITMAP *read_set_arg, MY_BITMAP *write_set_arg)
void column_bitmaps_set_no_signal (MY_BITMAP *read_set_arg, MY_BITMAP *write_set_arg)
void use_all_columns ()
void default_column_bitmaps ()
bool needs_reopen ()
bool alloc_keys (uint key_count)
 Allocate space for keys.
bool add_tmp_key (Field_map *key_parts, char *key_name)
 Add one key to a temporary table.
void use_index (int key_to_save)
void set_keyread (bool flag)
bool update_const_key_parts (Item *conds)
bool check_read_removal (uint index)
bool is_created () const
 Return true if table is instantiated, and false otherwise.
void set_created ()
void set_deleted ()

Public Attributes

TABLE_SHAREs
handlerfile
TABLEnext
TABLEprev
THD * in_use
Field ** field
uchar * record [2]
uchar * write_row_record
uchar * insert_values
key_map covering_keys
key_map quick_keys
key_map merge_keys
key_map used_keys
key_map possible_quick_keys
key_map keys_in_use_for_query
key_map keys_in_use_for_group_by
key_map keys_in_use_for_order_by
KEYkey_info
Fieldnext_number_field
Fieldfound_next_number_field
Table_triggers_listtriggers
TABLE_LISTpos_in_table_list
TABLE_LISTpos_in_locked_tables
ORDERgroup
const char * alias
uchar * null_flags
my_bitmap_map * bitmap_init_value
MY_BITMAP def_read_set
MY_BITMAP def_write_set
MY_BITMAP tmp_set
MY_BITMAPread_set
MY_BITMAPwrite_set
query_id_t query_id
ha_rows quick_rows [MAX_KEY]
key_part_map const_key_parts [MAX_KEY]
uint quick_key_parts [MAX_KEY]
uint quick_n_ranges [MAX_KEY]
ha_rows quick_condition_rows
table_map map
uint lock_position
uint lock_data_start
uint lock_count
uint tablenr
uint used_fields
uint temp_pool_slot
uint db_stat
int current_lock
uint maybe_null
my_bool null_row
uint8 status
my_bool copy_blobs
my_bool force_index
my_bool force_index_order
my_bool force_index_group
my_bool distinct
my_bool const_table
my_bool no_rows
my_bool key_read
my_bool no_keyread
my_bool locked_by_logger
my_bool no_replicate
my_bool locked_by_name
my_bool fulltext_searched
my_bool no_cache
my_bool open_by_handler
my_bool auto_increment_field_not_null
my_bool insert_or_update
my_bool alias_name_used
my_bool get_fields_in_item_tree
my_bool m_needs_reopen
uint max_keys
REGINFO reginfo
MEM_ROOT mem_root
Blob_mem_storageblob_storage
GRANT_INFO grant
Filesort_info sort
MDL_ticketmdl_ticket

Friends

class Table_cache_element

Detailed Description

Definition at line 974 of file table.h.

Member Function Documentation

bool TABLE::add_tmp_key ( Field_map key_parts,
char *  key_name 
)

Add one key to a temporary table.

Parameters
key_partsbitmap of fields that take a part in the key.
key_namename of the key

Creates a key for this table from fields which corresponds the bits set to 1 in the 'key_parts' bitmap. The 'key_name' name is given to the newly created key.

See Also
add_derived_key

somehow manage to create keys in tmp_table_param for unification purposes

Returns
TRUE OOM error.
FALSE the key was created or ignored (too long key).

Definition at line 5528 of file table.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool TABLE::alloc_keys ( uint  key_count)

Allocate space for keys.

Parameters
key_countnumber of keys to allocate.

Allocate space enough to fit 'key_count' keys for this table.

Returns
FALSE space was successfully allocated.
TRUE OOM error occur.

Definition at line 5496 of file table.cc.

Here is the caller graph for this function:

bool TABLE::check_read_removal ( uint  index)

Read removal is possible if the selected quick read method is using full unique index

See Also
HA_READ_BEFORE_WRITE_REMOVAL
Parameters
indexNumber of the index used for read
Return values
truesuccess, read removal started
falseread removal not started

Definition at line 6370 of file table.cc.

void TABLE::init ( THD *  thd,
TABLE_LIST tl 
)

Initialize TABLE instance (newly created, or coming either from table cache or THD::temporary_tables list) and prepare it for further use during statement execution. Set the 'alias' attribute from the specified TABLE_LIST element. Remember the TABLE_LIST element in the TABLE::pos_in_table_list member.

Parameters
thdThread context.
tlTABLE_LIST element.

Definition at line 3652 of file table.cc.

Here is the caller graph for this function:

void TABLE::mark_columns_needed_for_update ( void  )

Mark columns needed for doing an update of a row.

Some engines needs to have all columns in an update (to be able to build a complete row). If this is the case, we mark all not updated columns to be read.

If this is no the case, we do like in the delete case and mark if neeed, either the primary key column or all columns to be read. (see mark_columns_needed_for_delete() for details)

If the engine has HA_REQUIRES_KEY_COLUMNS_FOR_DELETE, we will mark all USED key columns as 'to-be-read'. This allows the engine to loop over the given record to find all changed keys and doesn't have to retrieve the row again.

Unlike other similar methods, it doesn't mark fields used by triggers, that is the responsibility of the caller to do, by using Table_triggers_list::mark_used_fields(TRG_EVENT_UPDATE)!

Definition at line 5341 of file table.cc.

Here is the call graph for this function:

void TABLE::mark_columns_per_binlog_row_image ( void  )

If in RBR we may need to mark some extra columns, depending on the binlog-row-image command line argument.

Definition at line 5416 of file table.cc.

Here is the caller graph for this function:

bool TABLE::needs_reopen ( )
inline

Should this instance of the table be reopened?

Definition at line 1239 of file table.h.

void TABLE::prepare_for_position ( void  )

Tell handler we are going to call position() and rnd_pos() later.

This is needed for handlers that uses the primary key to find the row. In this case we have to extend the read bitmap with the primary key fields.

Note
: Calling this function does not initialize the table for reading using rnd_pos(). rnd_init() still has to be called before rnd_pos().

Definition at line 5182 of file table.cc.

Here is the caller graph for this function:

void TABLE::set_created ( )
inline

Set the table as "created", and enable flags in storage engine that could not be enabled without an instantiated table.

Definition at line 1273 of file table.h.

Here is the caller graph for this function:

void TABLE::set_deleted ( )
inline

Set the contents of table to be "deleted", ie "not created", after having deleted the contents.

Definition at line 1285 of file table.h.

bool TABLE::update_const_key_parts ( Item conds)

Update TABLE::const_key_parts for single table UPDATE/DELETE query

Parameters
condsWHERE clause expression
Return values
TRUEerror (OOM)
FALSEsuccess
Note
Set const_key_parts bits if key fields are equal to constants in the WHERE expression.

Definition at line 6334 of file table.cc.

Member Data Documentation

Blob_mem_storage* TABLE::blob_storage

Initialized in Item_func_group_concat::setup for appropriate temporary table if GROUP_CONCAT is used with ORDER BY | DISTINCT and BLOB field count > 0.

Definition at line 1193 of file table.h.

my_bool TABLE::force_index_group

Flag set when the statement contains FORCE INDEX FOR GROUP BY See TABLE_LIST::process_index_hints().

Definition at line 1147 of file table.h.

my_bool TABLE::force_index_order

Flag set when the statement contains FORCE INDEX FOR ORDER BY See TABLE_LIST::process_index_hints().

Definition at line 1141 of file table.h.

my_bool TABLE::key_read

If set, the optimizer has found that row retrieval should access index tree only.

Definition at line 1154 of file table.h.

MEM_ROOT TABLE::mem_root
Todo:
This member should not be declared in-line. That makes it impossible for any function that does memory allocation to take a const reference to a TABLE object.

Definition at line 1187 of file table.h.

my_bool TABLE::no_replicate

If set, indicate that the table is not replicated by the server.

Definition at line 1160 of file table.h.


The documentation for this struct was generated from the following files: