diff options
Diffstat (limited to 'sql/mysqld.cc')
-rw-r--r-- | sql/mysqld.cc | 54 |
1 files changed, 49 insertions, 5 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fd794bfe02b..e77184999dc 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -100,6 +100,8 @@ #include "rpl_handler.h" +#include "transaction.h" + #ifdef HAVE_SYS_PRCTL_H #include <sys/prctl.h> #endif @@ -533,6 +535,8 @@ ulonglong slave_skipped_errors; ulong feature_files_opened_with_delayed_keys= 0, feature_check_constraint= 0; ulonglong denied_connections; my_decimal decimal_zero; +my_bool opt_transaction_registry= 1; +my_bool use_transaction_registry= 1; /* Maximum length of parameter value which can be set through @@ -945,6 +949,9 @@ PSI_mutex_key key_LOCK_prepare_ordered, key_LOCK_commit_ordered, key_LOCK_slave_background; PSI_mutex_key key_TABLE_SHARE_LOCK_share; +PSI_mutex_key key_TABLE_SHARE_LOCK_rotation; +PSI_cond_key key_TABLE_SHARE_COND_rotation; + static PSI_mutex_info all_server_mutexes[]= { #ifdef HAVE_MMAP @@ -1006,6 +1013,7 @@ static PSI_mutex_info all_server_mutexes[]= { &key_structure_guard_mutex, "Query_cache::structure_guard_mutex", 0}, { &key_TABLE_SHARE_LOCK_ha_data, "TABLE_SHARE::LOCK_ha_data", 0}, { &key_TABLE_SHARE_LOCK_share, "TABLE_SHARE::LOCK_share", 0}, + { &key_TABLE_SHARE_LOCK_rotation, "TABLE_SHARE::LOCK_rotation", 0}, { &key_LOCK_error_messages, "LOCK_error_messages", PSI_FLAG_GLOBAL}, { &key_LOCK_prepare_ordered, "LOCK_prepare_ordered", PSI_FLAG_GLOBAL}, { &key_LOCK_after_binlog_sync, "LOCK_after_binlog_sync", PSI_FLAG_GLOBAL}, @@ -1026,8 +1034,8 @@ static PSI_mutex_info all_server_mutexes[]= PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave, key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock, - key_LOCK_SEQUENCE; - + key_LOCK_SEQUENCE, + key_rwlock_LOCK_vers_stats, key_rwlock_LOCK_stat_serial; static PSI_rwlock_info all_server_rwlocks[]= { @@ -1040,7 +1048,9 @@ static PSI_rwlock_info all_server_rwlocks[]= { &key_rwlock_LOCK_sys_init_slave, "LOCK_sys_init_slave", PSI_FLAG_GLOBAL}, { &key_LOCK_SEQUENCE, "LOCK_SEQUENCE", 0}, { &key_rwlock_LOCK_system_variables_hash, "LOCK_system_variables_hash", PSI_FLAG_GLOBAL}, - { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0} + { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0}, + { &key_rwlock_LOCK_vers_stats, "Vers_field_stats::lock", 0}, + { &key_rwlock_LOCK_stat_serial, "TABLE_SHARE::LOCK_stat_serial", 0} }; #ifdef HAVE_MMAP @@ -1123,7 +1133,8 @@ static PSI_cond_info all_server_conds[]= { &key_COND_slave_background, "COND_slave_background", 0}, { &key_COND_start_thread, "COND_start_thread", PSI_FLAG_GLOBAL}, { &key_COND_wait_gtid, "COND_wait_gtid", 0}, - { &key_COND_gtid_ignore_duplicates, "COND_gtid_ignore_duplicates", 0} + { &key_COND_gtid_ignore_duplicates, "COND_gtid_ignore_duplicates", 0}, + { &key_TABLE_SHARE_COND_rotation, "TABLE_SHARE::COND_rotation", 0} }; PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert, @@ -6018,6 +6029,36 @@ int mysqld_main(int argc, char **argv) if (Events::init((THD*) 0, opt_noacl || opt_bootstrap)) unireg_abort(1); + if (opt_transaction_registry) + { + use_transaction_registry= true; + if (opt_bootstrap) + { + use_transaction_registry= false; + } + else + { + THD *thd = new THD(0); + thd->thread_stack= (char*) &thd; + thd->store_globals(); + { + TR_table trt(thd); + if (trt.check()) + { + use_transaction_registry= false; + } + } + + trans_commit_stmt(thd); + delete thd; + } + } + else + use_transaction_registry= false; + + if (opt_transaction_registry && !use_transaction_registry) + sql_print_information("Disabled transaction registry."); + if (WSREP_ON) { if (opt_bootstrap) @@ -9805,7 +9846,10 @@ static int get_options(int *argc_ptr, char ***argv_ptr) /* Ensure that some variables are not set higher than needed */ if (thread_cache_size > max_connections) SYSVAR_AUTOSIZE(thread_cache_size, max_connections); - + + if (opt_bootstrap) + global_system_variables.vers_force= 0; + return 0; } |