My Project
Public Member Functions | Public Attributes | Friends
TABLE Struct Reference

List of all members.

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
Fieldfts_doc_id_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_BITMAP * read_set
MY_BITMAP * write_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

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).
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.
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
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.

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)!

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

bool TABLE::needs_reopen ( ) [inline]

Should this instance of the table be reopened?

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().
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.

void TABLE::set_deleted ( ) [inline]

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

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.

Member Data Documentation

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.

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

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

my_bool TABLE::key_read

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

This table must be reopened and is not to be reused. NOTE: The TABLE will not be reopened during LOCK TABLES in close_thread_tables!!!

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.

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


The documentation for this struct was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines