summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorunknown <cmiller@zippy.cornsilk.net>2007-12-14 13:42:09 -0500
committerunknown <cmiller@zippy.cornsilk.net>2007-12-14 13:42:09 -0500
commit7fd0ad21a77e64d2ff6351f532962a247674833b (patch)
tree7f9d91b59c01dc2a804c5498341858c5b29423e3 /sql/table.h
parent72d97dfdaed719b3b7ffd8a65f0c9096a479d7b5 (diff)
parent18f5e87ed930aa66fd7c8ea2b36c9cfc103d8a40 (diff)
downloadmariadb-git-7fd0ad21a77e64d2ff6351f532962a247674833b.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 CMakeLists.txt: Auto merged configure.in: Auto merged libmysql/CMakeLists.txt: Auto merged libmysqld/lib_sql.cc: Auto merged mysql-test/r/information_schema_db.result: Auto merged mysql-test/t/information_schema.test: Auto merged sql/CMakeLists.txt: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/lock.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/repl_failsafe.cc: Auto merged sql/set_var.cc: Auto merged sql/set_var.h: Auto merged sql/sp_head.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_view.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/structs.h: Auto merged sql/table.h: Auto merged storage/archive/ha_archive.cc: Auto merged storage/myisam/ha_myisam.cc: Auto merged storage/myisam/mi_open.c: Auto merged storage/myisammrg/ha_myisammrg.cc: Auto merged support-files/mysql.spec.sh: Auto merged client/mysqlcheck.c: Manual merge. mysql-test/r/information_schema.result: Manual merge. mysql-test/r/mysqlcheck.result: Manual merge. mysql-test/t/mysqlcheck.test: Manual merge. sql/slave.cc: Manual merge. sql/sql_base.cc: Manual merge. sql/sql_delete.cc: Manual merge. sql/sql_parse.cc: Manual merge. sql/sql_update.cc: Manual merge.
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;