summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorcmiller@zippy.cornsilk.net <>2007-12-14 13:42:09 -0500
committercmiller@zippy.cornsilk.net <>2007-12-14 13:42:09 -0500
commitedbacd3a999a631e53407aee9b14ec5a8f2d4094 (patch)
tree7f9d91b59c01dc2a804c5498341858c5b29423e3 /sql/table.h
parent79bb729e5468586602fe0aa555b0488218bda4bc (diff)
parentc940d64a69474c165e3988eb7ad93f16a88ef852 (diff)
downloadmariadb-git-edbacd3a999a631e53407aee9b14ec5a8f2d4094.tar.gz
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-forcollapseandmerge
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/sql/table.h b/sql/table.h
index f3cfd75e022..43070257c69 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -431,6 +431,12 @@ typedef struct st_table_share
{
return (table_category == TABLE_CATEGORY_PERFORMANCE);
}
+
+ inline ulong get_table_def_version()
+ {
+ return table_map_id;
+ }
+
} TABLE_SHARE;
@@ -455,6 +461,11 @@ struct st_table {
#endif
struct st_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_LIST *child_l; /* Set in MERGE parent. List of children */
+ TABLE_LIST **child_last_l; /* Set in MERGE parent. End of list */
+
THD *in_use; /* Which thread uses this */
Field **field; /* Pointer to fields */
@@ -622,6 +633,8 @@ struct st_table {
my_bool insert_or_update; /* Can be used by the handler */
my_bool alias_name_used; /* true if table_name is alias */
my_bool get_fields_in_item_tree; /* Signal to fix_field */
+ /* If MERGE children attached to parent. See top comment in ha_myisammrg.cc */
+ my_bool children_attached;
REGINFO reginfo; /* field connections */
MEM_ROOT mem_root;
@@ -673,6 +686,7 @@ struct st_table {
*/
inline bool needs_reopen_or_name_lock()
{ return s->version != refresh_version; }
+ bool is_children_attached(void);
};
enum enum_schema_table_state
@@ -997,6 +1011,8 @@ struct TABLE_LIST
(non-zero only for merged underlying tables of a view).
*/
TABLE_LIST *referencing_view;
+ /* Ptr to parent MERGE table list item. See top comment in ha_myisammrg.cc */
+ TABLE_LIST *parent_l;
/*
Security context (non-zero only for tables which belong
to view with SQL SECURITY DEFINER)
@@ -1177,6 +1193,20 @@ struct TABLE_LIST
*/
bool process_index_hints(TABLE *table);
+ /* Access MERGE child def version. See top comment in ha_myisammrg.cc */
+ inline ulong get_child_def_version()
+ {
+ return child_def_version;
+ }
+ inline void set_child_def_version(ulong version)
+ {
+ child_def_version= version;
+ }
+ inline void init_child_def_version()
+ {
+ child_def_version= ~0UL;
+ }
+
private:
bool prep_check_option(THD *thd, uint8 check_opt_type);
bool prep_where(THD *thd, Item **conds, bool no_where_clause);
@@ -1184,6 +1214,9 @@ private:
Cleanup for re-execution in a prepared statement or a stored
procedure.
*/
+
+ /* Remembered MERGE child def version. See top comment in ha_myisammrg.cc */
+ ulong child_def_version;
};
class Item;