diff options
Diffstat (limited to 'sql/table.h')
-rw-r--r-- | sql/table.h | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/sql/table.h b/sql/table.h index 229d41a2df7..02abb090426 100644 --- a/sql/table.h +++ b/sql/table.h @@ -105,6 +105,7 @@ struct st_table { *rowid_field; Field_timestamp *timestamp_field; my_string comment; /* Comment about table */ + CHARSET_INFO *table_charset; /* Default charset of string fields */ REGINFO reginfo; /* field connections */ MEM_ROOT mem_root; GRANT_INFO grant; @@ -140,21 +141,29 @@ typedef struct st_table_list struct st_table_list *next; char *db,*name,*real_name; uint32 db_length, real_name_length; - Item *on_expr; /* Used with outer join */ - struct st_table_list *natural_join; /* natural join on this table*/ + Item *on_expr; /* Used with outer join */ + struct st_table_list *natural_join; /* natural join on this table*/ /* ... join ... USE INDEX ... IGNORE INDEX */ - List<String> *use_index,*ignore_index; - TABLE *table; + List<String> *use_index, *ignore_index; + /* + Usually hold reference on opened table, but may hold reference + to node of complete list of tables used in UNION & subselect. + */ + union + { + TABLE *table; /* opened table */ + st_table_list *table_list; /* pointer to node of list of all tables */ + }; GRANT_INFO grant; thr_lock_type lock_type; - uint outer_join; /* Which join type */ - bool straight; /* optimize with prev table */ - bool updating; /* for replicate-do/ignore table */ - bool shared; /* Used twice in union */ - bool do_redirect; /* To get the struct in UNION's */ + uint outer_join; /* Which join type */ + bool straight; /* optimize with prev table */ + bool updating; /* for replicate-do/ignore table */ + bool shared; /* Used twice in union */ + bool do_redirect; /* If *table has to be fixed in UNION */ + void *derived; /* SELECT_LEX_UNIT of derived table */ } TABLE_LIST; - typedef struct st_changed_table_list { struct st_changed_table_list *next; @@ -162,7 +171,6 @@ typedef struct st_changed_table_list uint32 key_length; } CHANGED_TABLE_LIST; - typedef struct st_open_table_list { struct st_open_table_list *next; |