diff options
author | unknown <knielsen@knielsen-hq.org> | 2013-04-15 10:55:27 +0200 |
---|---|---|
committer | unknown <knielsen@knielsen-hq.org> | 2013-04-15 10:55:27 +0200 |
commit | 665a31af2b7d0ecd66d5e54ed0544b5db3892732 (patch) | |
tree | d19eae18ae9ffff6e7b3d30b16cf7671c511700f /sql/sql_base.cc | |
parent | 491047a24714be57409e42656057e56f99c65513 (diff) | |
parent | e5cbefeb899f6325fc99277c515a91f0843cdcd5 (diff) | |
download | mariadb-git-665a31af2b7d0ecd66d5e54ed0544b5db3892732.tar.gz |
MDEV-26: Global transaction ID. First alpha release.
Merge of 10.0-mdev26 feature tree into 10.0-base.
Global transaction ID is prepended to each event group in the binlog.
Slave connect can request to start from GTID position instead of specifying
file name/offset of master binlog. This facilitates easy switch to a new
master.
Slave GTID state is stored in a table mysql.rpl_slave_state, which can be
InnoDB to get crash-safe slave state.
GTID includes a replication domain ID, allowing to keep track of distinct
positions for each of multiple masters.
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 39dad6f075c..dd92c3d6750 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -345,7 +345,7 @@ uint create_tmp_table_def_key(THD *thd, char *key, const char *db, const char *table_name) { uint key_length= create_table_def_key(key, db, table_name); - int4store(key + key_length, thd->server_id); + int4store(key + key_length, thd->variables.server_id); int4store(key + key_length + 4, thd->variables.pseudo_thread_id); key_length+= TMP_TABLE_KEY_EXTRA; return key_length; @@ -388,6 +388,14 @@ bool table_def_init(void) init_tdc_psi_keys(); #endif mysql_mutex_init(key_LOCK_open, &LOCK_open, MY_MUTEX_INIT_FAST); + mysql_mutex_record_order(&LOCK_active_mi, &LOCK_open); + /* + When we delete from the table_def_cache(), the free function + table_def_free_entry() is invoked from my_hash_delete(), which calls + free_table_share(), which may unload plugins, which can remove status + variables and hence takes LOCK_status. Record this locking order here. + */ + mysql_mutex_record_order(&LOCK_open, &LOCK_status); oldest_unused_share= &end_of_unused_share; end_of_unused_share.prev= &oldest_unused_share; @@ -2662,7 +2670,7 @@ bool open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, { DBUG_PRINT("error", ("query_id: %lu server_id: %u pseudo_thread_id: %lu", - (ulong) table->query_id, (uint) thd->server_id, + (ulong) table->query_id, (uint) thd->variables.server_id, (ulong) thd->variables.pseudo_thread_id)); my_error(ER_CANT_REOPEN_TABLE, MYF(0), table->alias.c_ptr()); DBUG_RETURN(TRUE); @@ -5939,7 +5947,8 @@ TABLE *open_table_uncached(THD *thd, handlerton *hton, ("table: '%s'.'%s' path: '%s' server_id: %u " "pseudo_thread_id: %lu", db, table_name, path, - (uint) thd->server_id, (ulong) thd->variables.pseudo_thread_id)); + (uint) thd->variables.server_id, + (ulong) thd->variables.pseudo_thread_id)); /* Create the cache_key for temporary tables */ key_length= create_tmp_table_def_key(thd, cache_key, db, table_name); |