Drizzled Public API Documentation

dict_table_struct Struct Reference

#include <dict0mem.h>

Public Attributes

table_id_t id
 
mem_heap_theap
 
char * name
 
const char * dir_path_of_temp_table
 
unsigned space:32
 
unsigned flags:DICT_TF2_BITS
 
unsigned ibd_file_missing:1
 
unsigned tablespace_discarded:1
 
unsigned cached:1
 
unsigned n_def:10
 
unsigned n_cols:10
 
unsigned corrupted:1
 
dict_col_tcols
 
const char * col_names
 
hash_node_t name_hash
 
hash_node_t id_hash
 
 indexes
 
 foreign_list
 
 referenced_list
 
 table_LRU
 
ulint n_mysql_handles_opened
 
unsigned fk_max_recusive_level:8
 
ulint n_foreign_key_checks_running
 
trx_id_t query_cache_inv_trx_id
 
 locks
 
unsigned big_rows:1
 
unsigned stat_initialized:1
 
ib_int64_t stat_n_rows
 
ulint stat_clustered_index_size
 
ulint stat_sum_of_other_index_sizes
 
ulint stat_modified_counter
 
lock_tautoinc_lock
 
mutex_t autoinc_mutex
 
ib_uint64_t autoinc
 
ulong n_waiting_or_granted_auto_inc_locks
 
const trx_tautoinc_trx
 

Detailed Description

Data structure for a database table.  Most fields will be

initialized to 0, NULL or FALSE in dict_mem_table_create().

Definition at line 476 of file dict0mem.h.

Member Data Documentation

ib_uint64_t dict_table_struct::autoinc
               autoinc counter value to give to the

next inserted row

Definition at line 628 of file dict0mem.h.

Referenced by dict_mem_table_create(), dict_table_autoinc_initialize(), dict_table_autoinc_read(), and dict_table_autoinc_update_if_greater().

lock_t* dict_table_struct::autoinc_lock

!< The following fields are used by the AUTOINC code. The actual collection of tables locked during AUTOINC read/write is kept in trx_t. In order to quickly determine whether a transaction has locked the AUTOINC lock we keep a pointer to the transaction here in the autoinc_trx variable. This is to avoid acquiring the kernel mutex and scanning the vector in trx_t.

When an AUTOINC lock has to wait, the corresponding lock instance is created on the trx lock heap rather than use the pre-allocated instance in autoinc_lock below. a buffer for an AUTOINC lock for this table: we allocate the memory here so that individual transactions can get it and release it without a need to allocate space from the lock heap of the trx: otherwise the lock heap would grow rapidly if we do a large insert from a select

Definition at line 617 of file dict0mem.h.

Referenced by dict_mem_table_create().

mutex_t dict_table_struct::autoinc_mutex
const trx_t* dict_table_struct::autoinc_trx
 The transaction that currently holds the

the AUTOINC lock on this table.

Definition at line 639 of file dict0mem.h.

Referenced by row_lock_table_autoinc_for_mysql().

unsigned dict_table_struct::big_rows
 flag: TRUE if the maximum length of

a single row exceeds BIG_ROW_SIZE; initialized in dict_table_add_to_cache()

Definition at line 570 of file dict0mem.h.

Referenced by dict_table_add_to_cache().

unsigned dict_table_struct::cached
            TRUE if the table object has been added

to the dictionary cache

Definition at line 500 of file dict0mem.h.

Referenced by dict_mem_table_free(), dict_table_add_system_columns(), dict_table_add_to_cache(), and dict_table_rename_in_cache().

const char* dict_table_struct::col_names
 Column names packed in a character string

"name1\0name2\0...nameN\0". Until the string contains n_cols, it will be allocated from a temporary heap. The final string will be allocated from table->heap.

Definition at line 507 of file dict0mem.h.

Referenced by dict_mem_table_add_col(), and dict_table_get_col_name().

dict_col_t* dict_table_struct::cols

array of column descriptions

Definition at line 506 of file dict0mem.h.

Referenced by build_template(), calc_row_difference(), dict_mem_table_create(), and mlog_parse_index().

unsigned dict_table_struct::corrupted

TRUE if table is corrupted

Definition at line 504 of file dict0mem.h.

const char* dict_table_struct::dir_path_of_temp_table
                              NULL or the directory path

where a TEMPORARY table that was explicitly created by a user should be placed if innodb_file_per_table is defined in my.cnf; in Unix this is usually /tmp/..., in Windows temp...

Definition at line 480 of file dict0mem.h.

Referenced by create_table_def(), dict_table_rename_in_cache(), row_drop_table_for_mysql(), and row_truncate_table_for_mysql().

unsigned dict_table_struct::fk_max_recusive_level
 maximum recursive level we support when

loading tables chained together with FK constraints. If exceeds this level, we will stop loading child table into memory along with its parent table

Definition at line 533 of file dict0mem.h.

Referenced by dict_load_table().

unsigned dict_table_struct::ibd_file_missing
 TRUE if this is in a single-table

tablespace and the .ibd file is missing; then we must return in ha_innodb.cc an error if the user tries to query such an orphaned table

Definition at line 490 of file dict0mem.h.

Referenced by ha_innobase::check(), dict_load_table(), dict_update_statistics(), ha_innobase::doOpen(), row_discard_tablespace_for_mysql(), row_import_tablespace_for_mysql(), row_ins_check_foreign_constraint(), row_insert_for_mysql(), row_rename_table_for_mysql(), row_search_for_mysql(), row_truncate_table_for_mysql(), and row_update_for_mysql().

hash_node_t dict_table_struct::id_hash

hash chain node

Definition at line 515 of file dict0mem.h.

dict_table_struct::locks
unsigned dict_table_struct::n_cols
unsigned dict_table_struct::n_def

number of columns defined so far

Definition at line 502 of file dict0mem.h.

Referenced by dict_load_column_low(), dict_mem_table_add_col(), dict_table_add_system_columns(), and dict_table_add_to_cache().

ulint dict_table_struct::n_foreign_key_checks_running
 count of how many foreign key check

operations are currently being performed on the table: we cannot drop the table while there are foreign key checks running on it!

Definition at line 539 of file dict0mem.h.

Referenced by row_discard_tablespace_for_mysql(), row_drop_table_for_mysql(), and row_truncate_table_for_mysql().

ulint dict_table_struct::n_mysql_handles_opened
 count of how many handles MySQL has opened

to this table; dropping of the table is NOT allowed until this count gets to zero; MySQL does NOT itself check the number of open handles at drop

Definition at line 527 of file dict0mem.h.

Referenced by dict_table_decrement_handle_count(), dict_table_get(), row_drop_database_for_mysql(), row_drop_table_for_mysql(), and row_merge_drop_table().

ulong dict_table_struct::n_waiting_or_granted_auto_inc_locks
 This counter is used to track the number

of granted and pending autoinc locks on this table. This value is set after acquiring the kernel mutex but we peek the contents to determine whether other transactions have acquired the AUTOINC lock or not. Of course only one transaction can be granted the lock but there can be multiple waiters.

Definition at line 630 of file dict0mem.h.

Referenced by dict_mem_table_create().

hash_node_t dict_table_struct::name_hash

hash chain node

Definition at line 514 of file dict0mem.h.

trx_id_t dict_table_struct::query_cache_inv_trx_id
 transactions whose trx id is

smaller than this number are not allowed to store to the MySQL query cache or retrieve from it; when a trx with undo logs commits, it sets this to the value of the trx id counter for the tables it had an IX lock on

Definition at line 545 of file dict0mem.h.

Referenced by lock_release_off_kernel(), and row_search_check_if_query_cache_permitted().

ulint dict_table_struct::stat_clustered_index_size
 approximate clustered index size in

database pages

Definition at line 582 of file dict0mem.h.

Referenced by dict_update_statistics(), ha_innobase::info(), and ha_innobase::scan_time().

unsigned dict_table_struct::stat_initialized

Statistics for query optimization TRUE if statistics have been calculated the first time after database startup or table creation

Definition at line 576 of file dict0mem.h.

Referenced by dict_update_statistics().

ulint dict_table_struct::stat_modified_counter
 when a row is inserted, updated,

or deleted, we add 1 to this number; we calculate new estimates for the stat_... values for the table and the indexes at an interval of 2 GB or when about 1 / 16 of table has been modified; also when the estimate operation is called for MySQL SHOW TABLE STATUS; the counter is reset to zero at statistics calculation; this counter is not protected by any latch, because this is only used for heuristics

Definition at line 587 of file dict0mem.h.

Referenced by dict_update_statistics().

ib_int64_t dict_table_struct::stat_n_rows
 approximate number of rows in the table;

we periodically calculate new estimates

Definition at line 579 of file dict0mem.h.

Referenced by btr_estimate_n_rows_in_range(), dict_table_print_low(), dict_update_statistics(), ha_innobase::info(), row_insert_for_mysql(), row_update_cascade_for_mysql(), and row_update_for_mysql().

ulint dict_table_struct::stat_sum_of_other_index_sizes

other indexes in database pages

Definition at line 585 of file dict0mem.h.

Referenced by dict_update_statistics(), and ha_innobase::info().

dict_table_struct::table_LRU

node of the LRU list of tables

Definition at line 526 of file dict0mem.h.

unsigned dict_table_struct::tablespace_discarded
 this flag is set TRUE when the user

calls DISCARD TABLESPACE on this table, and reset to FALSE in IMPORT TABLESPACE

Definition at line 495 of file dict0mem.h.

Referenced by row_discard_tablespace_for_mysql(), and row_import_tablespace_for_mysql().


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