summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-08-20 16:35:23 +0200
committerunknown <guilhem@mysql.com>2004-08-20 16:35:23 +0200
commitcd8054d4318077827bcf20e640af6fcddf1d9525 (patch)
tree9d89f6beb28a1d747c302488d23cb8d5bfca7507 /sql/sql_class.h
parentf758ada4bcfdf9b22b1603bc273b5e2a6436037b (diff)
downloadmariadb-git-cd8054d4318077827bcf20e640af6fcddf1d9525.tar.gz
Making FLUSH TABLES WITH READ LOCK block COMMITs of existing transactions,
in a deadlock-free manner. This splits locking the global read lock in two steps. This fixes a consequence of this bug, known as: BUG#4953 'mysqldump --master-data may report incorrect binlog position if using InnoDB' And a test. sql/handler.cc: making COMMIT wait if FLUSH TABLES WITH READ LOCK happened. sql/lock.cc: an additional stage so that FLUSH TABLES WITH READ LOCK blocks COMMIT: make_global_read_lock_block_commit(): taking the global read lock is TWO steps (2nd step is optional; without it, COMMIT of existing transactions will be allowed): lock_global_read_lock() THEN make_global_read_lock_block_commit(). sql/mysql_priv.h: new argument to wait_if_global_read_lock() sql/sql_class.h: THD::global_read_lock now an uint to reflect the 2 steps of global read lock (does not block COMMIT / does) sql/sql_db.cc: update for new prototype sql/sql_parse.cc: implementing the two steps of global read lock so that FLUSH TABLES WITH READ LOCK can block COMMIT without deadlocking with COMMITs.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 3c968c6a8ae..30947041b7d 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -478,7 +478,7 @@ public:
ulong rand_saved_seed1, rand_saved_seed2;
long dbug_thread_id;
pthread_t real_id;
- uint current_tablenr,tmp_table,cond_count;
+ uint current_tablenr,tmp_table,cond_count,global_read_lock;
uint server_status,open_options,system_thread;
uint32 query_length;
uint32 db_length;
@@ -489,7 +489,7 @@ public:
bool set_query_id,locked,count_cuted_fields,some_tables_deleted;
bool no_errors, allow_sum_func, password, fatal_error;
bool query_start_used,last_insert_id_used,insert_id_used,rand_used;
- bool in_lock_tables,global_read_lock;
+ bool in_lock_tables;
bool query_error, bootstrap, cleanup_done;
bool safe_to_cache_query;
bool volatile killed;