diff options
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/sql/table.h b/sql/table.h index f9da0637b4b..49a97958807 100644 --- a/sql/table.h +++ b/sql/table.h @@ -293,9 +293,9 @@ TABLE_CATEGORY get_table_category(const LEX_STRING *db, instance of table share per one table in the database. */ -typedef struct st_table_share +struct TABLE_SHARE { - st_table_share() {} /* Remove gcc warning */ + TABLE_SHARE() {} /* Remove gcc warning */ /** Category of this table. */ TABLE_CATEGORY table_category; @@ -308,11 +308,7 @@ typedef struct st_table_share TYPELIB *intervals; /* pointer to interval info */ pthread_mutex_t mutex; /* For locking the share */ pthread_cond_t cond; /* To signal that share is ready */ - struct st_table_share *next, /* Link to unused shares */ - **prev; -#ifdef NOT_YET - struct st_table *open_tables; /* link to open tables */ -#endif + TABLE_SHARE *next, **prev; /* Link to unused shares */ /* The following is copied to each TABLE on OPEN */ Field **field; @@ -426,6 +422,7 @@ typedef struct st_table_share /** place to store storage engine specific data */ void *ha_data; + void (*ha_data_destroy)(void *); /* An optional destructor for ha_data */ /* @@ -595,7 +592,7 @@ typedef struct st_table_share return (tmp_table == SYSTEM_TMP_TABLE || is_view) ? 0 : table_map_id; } -} TABLE_SHARE; +}; extern ulong refresh_version; @@ -608,19 +605,16 @@ enum index_hint_type INDEX_HINT_FORCE }; -struct st_table { - st_table() {} /* Remove gcc warning */ +struct TABLE +{ + TABLE() {} /* Remove gcc warning */ TABLE_SHARE *s; handler *file; -#ifdef NOT_YET - struct st_table *used_next, **used_prev; /* Link to used tables */ - struct st_table *open_next, **open_prev; /* Link to open tables */ -#endif - struct st_table *next, *prev; + TABLE *next, *prev; /* For the below MERGE related members see top comment in ha_myisammrg.cc */ - struct st_table *parent; /* Set in MERGE child. Ptr to parent */ + TABLE *parent; /* Set in MERGE child. Ptr to parent */ TABLE_LIST *child_l; /* Set in MERGE parent. List of children */ TABLE_LIST **child_last_l; /* Set in MERGE parent. End of list */ @@ -1014,7 +1008,6 @@ typedef struct st_schema_table /** The threshold size a blob field buffer before it is freed */ #define MAX_TDC_BLOB_SIZE 65536 -struct st_lex; class select_union; class TMP_TABLE_PARAM; @@ -1092,6 +1085,7 @@ public: (TABLE_LIST::join_using_fields != NULL) */ +struct LEX; class Index_hint; struct TABLE_LIST { @@ -1212,7 +1206,7 @@ struct TABLE_LIST TMP_TABLE_PARAM *schema_table_param; /* link to select_lex where this table was used */ st_select_lex *select_lex; - st_lex *view; /* link on VIEW lex for merging */ + LEX *view; /* link on VIEW lex for merging */ Field_translator *field_translation; /* array of VIEW fields */ /* pointer to element after last one in translation table above */ Field_translator *field_translation_end; @@ -1371,6 +1365,8 @@ struct TABLE_LIST the parsed tree is created. */ uint8 trg_event_map; + /* TRUE <=> this table is a const one and was optimized away. */ + bool optimized_away; uint i_s_requested_object; bool has_db_lookup_value; @@ -1427,9 +1423,9 @@ struct TABLE_LIST Item_subselect *containing_subselect(); /* - Compiles the tagged hints list and fills up st_table::keys_in_use_for_query, - st_table::keys_in_use_for_group_by, st_table::keys_in_use_for_order_by, - st_table::force_index and st_table::covering_keys. + Compiles the tagged hints list and fills up TABLE::keys_in_use_for_query, + TABLE::keys_in_use_for_group_by, TABLE::keys_in_use_for_order_by, + TABLE::force_index and TABLE::covering_keys. */ bool process_index_hints(TABLE *table); |