From 63e56390a3f1a4f80642932a790ab74f28de8010 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 10 Sep 2009 03:18:29 -0600 Subject: WL#2110 (SIGNAL) WL#2265 (RESIGNAL) Manual merge of SIGNAL and RESIGNAL to mysql-trunk-signal, plus required dependencies. --- sql/mysqld.cc | 82 +++++++++++++---------------------------------------------- 1 file changed, 17 insertions(+), 65 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 5dad29a1ab7..6d0a5adc1ad 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -628,6 +628,7 @@ MY_BITMAP temp_pool; CHARSET_INFO *system_charset_info, *files_charset_info ; CHARSET_INFO *national_charset_info, *table_alias_charset; CHARSET_INFO *character_set_filesystem; +CHARSET_INFO *error_message_charset_info; MY_LOCALE *my_default_lc_time_names; @@ -1808,7 +1809,8 @@ void close_connection(THD *thd, uint errcode, bool lock) if ((vio= thd->net.vio) != 0) { if (errcode) - net_send_error(thd, errcode, ER(errcode)); /* purecov: inspected */ + net_send_error(thd, errcode, + ER(errcode), NULL); /* purecov: inspected */ vio_close(vio); /* vio is freed in delete thd */ } if (lock) @@ -2854,11 +2856,11 @@ static void check_data_home(const char *path) for the client. */ /* ARGSUSED */ -extern "C" int my_message_sql(uint error, const char *str, myf MyFlags); +extern "C" void my_message_sql(uint error, const char *str, myf MyFlags); -int my_message_sql(uint error, const char *str, myf MyFlags) +void my_message_sql(uint error, const char *str, myf MyFlags) { - THD *thd; + THD *thd= current_thd; DBUG_ENTER("my_message_sql"); DBUG_PRINT("error", ("error: %u message: '%s'", error, str)); @@ -2880,70 +2882,18 @@ int my_message_sql(uint error, const char *str, myf MyFlags) error= ER_UNKNOWN_ERROR; } - if ((thd= current_thd)) + if (thd) { - /* - TODO: There are two exceptions mechanism (THD and sp_rcontext), - this could be improved by having a common stack of handlers. - */ - if (thd->handle_error(error, str, - MYSQL_ERROR::WARN_LEVEL_ERROR)) - DBUG_RETURN(0); - - thd->is_slave_error= 1; // needed to catch query errors during replication - - /* - thd->lex->current_select == 0 if lex structure is not inited - (not query command (COM_QUERY)) - */ - if (thd->lex->current_select && - thd->lex->current_select->no_error && !thd->is_fatal_error) - { - DBUG_PRINT("error", - ("Error converted to warning: current_select: no_error %d " - "fatal_error: %d", - (thd->lex->current_select ? - thd->lex->current_select->no_error : 0), - (int) thd->is_fatal_error)); - } - else - { - if (! thd->main_da.is_error()) // Return only first message - { - thd->main_da.set_error_status(thd, error, str); - } - query_cache_abort(&thd->net); - } - /* - If a continue handler is found, the error message will be cleared - by the stored procedures code. - */ - if (thd->spcont && - ! (MyFlags & ME_NO_SP_HANDLER) && - thd->spcont->handle_error(error, MYSQL_ERROR::WARN_LEVEL_ERROR, thd)) - { - /* - Do not push any warnings, a handled error must be completely - silenced. - */ - DBUG_RETURN(0); - } - - if (!thd->no_warnings_for_error && - !(MyFlags & ME_NO_WARNING_FOR_ERROR)) - { - /* - Suppress infinite recursion if there a memory allocation error - inside push_warning. - */ - thd->no_warnings_for_error= TRUE; - push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, error, str); - thd->no_warnings_for_error= FALSE; - } + if (MyFlags & ME_FATALERROR) + thd->is_fatal_error= 1; + (void) thd->raise_condition(error, + NULL, + MYSQL_ERROR::WARN_LEVEL_ERROR, + str); } if (!thd || MyFlags & ME_NOREFRESH) sql_print_error("%s: %s",my_progname,str); /* purecov: inspected */ - DBUG_RETURN(0); + DBUG_VOID_RETURN; } @@ -3107,6 +3057,7 @@ SHOW_VAR com_status_vars[]= { {"replace", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE]), SHOW_LONG_STATUS}, {"replace_select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REPLACE_SELECT]), SHOW_LONG_STATUS}, {"reset", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESET]), SHOW_LONG_STATUS}, + {"resignal", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESIGNAL]), SHOW_LONG_STATUS}, {"restore_table", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_RESTORE_TABLE]), SHOW_LONG_STATUS}, {"revoke", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REVOKE]), SHOW_LONG_STATUS}, {"revoke_all", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_REVOKE_ALL]), SHOW_LONG_STATUS}, @@ -3115,6 +3066,7 @@ SHOW_VAR com_status_vars[]= { {"savepoint", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SAVEPOINT]), SHOW_LONG_STATUS}, {"select", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SELECT]), SHOW_LONG_STATUS}, {"set_option", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SET_OPTION]), SHOW_LONG_STATUS}, + {"signal", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SIGNAL]), SHOW_LONG_STATUS}, {"show_authors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_AUTHORS]), SHOW_LONG_STATUS}, {"show_binlog_events", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOG_EVENTS]), SHOW_LONG_STATUS}, {"show_binlogs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS}, @@ -4939,7 +4891,7 @@ void create_thread_to_handle_connection(THD *thd) /* Can't use my_error() since store_globals has not been called. */ my_snprintf(error_message_buff, sizeof(error_message_buff), ER(ER_CANT_CREATE_THREAD), error); - net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff); + net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff, NULL); (void) pthread_mutex_lock(&LOCK_thread_count); close_connection(thd,0,0); delete thd; -- cgit v1.2.1 From 623ed58cfda0aef6b6bf545a4200357a58a8a4cc Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Sat, 26 Sep 2009 12:49:49 +0800 Subject: Backporting WL#4398 WL#1720 Backporting BUG#44058 BUG#42244 BUG#45672 BUG#45673 Backporting BUG#45819 BUG#45973 BUG#39012 --- sql/mysqld.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7e9eb6e7291..2ae4ec9e9b6 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -31,6 +31,8 @@ #include "rpl_injector.h" +#include "rpl_handler.h" + #ifdef HAVE_SYS_PRCTL_H #include #endif @@ -1284,6 +1286,7 @@ void clean_up(bool print_message) ha_end(); if (tc_log) tc_log->close(); + delegates_destroy(); xid_cache_free(); delete_elements(&key_caches, (void (*)(const char*, uchar*)) free_key_cache); multi_keycache_free(); @@ -3760,6 +3763,13 @@ static int init_server_components() unireg_abort(1); } + /* initialize delegates for extension observers */ + if (delegates_init()) + { + sql_print_error("Initialize extension delegates failed"); + unireg_abort(1); + } + /* need to configure logging before initializing storage engines */ if (opt_update_log) { -- cgit v1.2.1 From f0886a4d9dfc36e92f7254c958ec73476704c4d4 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 29 Sep 2009 00:04:20 +0100 Subject: BUG#28777, WL#4293: SHOW BINLOG EVENTS does not work on relay log files NOTE: this is the backport to next-mr. SHOW BINLOG EVENTS does not work with relay log files. If issuing "SHOW BINLOG EVENTS IN 'relay-log.000001'" in a non-empty relay log file (relay-log.000001), mysql reports empty set. This patch addresses this issue by extending the SHOW command with RELAYLOG. Events in relay log files can now be inspected by issuing SHOW RELAYLOG EVENTS [IN 'log_name'] [FROM pos] [LIMIT [offset,] row_count]. mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc: Shared part of the test case. mysql-test/include/show_binlog_events.inc: Added options $binary_log_file, $binary_log_limit_row, $binary_log_limit_offset so that show_binlog_events can take same parameters as SHOW BINLOG EVENTS does. mysql-test/include/show_relaylog_events.inc: Clone of show_binlog_events for relaylog events. mysql-test/suite/rpl/t/rpl_row_show_relaylog_events.test: Test case for row based replication. mysql-test/suite/rpl/t/rpl_stm_mix_show_relaylog_events.test: Test case for statement and mixed mode replication. sql/lex.h: Added RELAYLOG symbol. sql/mysqld.cc: Added "show_relaylog_events" to status_vars. sql/sp_head.cc: Set SQLCOM_SHOW_RELAYLOG_EVENTS to return flags= sp_head::MULTI_RESULTS; in sp_get_flags_for_command as SQLCOM_SHOW_BINLOG_EVENTS does. sql/sql_lex.h: Added sql_command SQLCOM_SHOW_RELAYLOG_EVENTS to lex enum_sql_command. sql/sql_parse.cc: Added handling of SQLCOM_SHOW_RELAYLOG_EVENTS. sql/sql_repl.cc: mysql_show_binlog_events set to choose the log file to use based on the command issued (SHOW BINLOG|RELAYLOG EVENTS). sql/sql_yacc.yy: Added RELAYLOG to the grammar. --- sql/mysqld.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7e9eb6e7291..9b70096eb73 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3135,6 +3135,7 @@ SHOW_VAR com_status_vars[]= { {"show_processlist", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PROCESSLIST]), SHOW_LONG_STATUS}, {"show_profile", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PROFILE]), SHOW_LONG_STATUS}, {"show_profiles", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_PROFILES]), SHOW_LONG_STATUS}, + {"show_relaylog_events", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_RELAYLOG_EVENTS]), SHOW_LONG_STATUS}, {"show_slave_hosts", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_HOSTS]), SHOW_LONG_STATUS}, {"show_slave_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_SLAVE_STAT]), SHOW_LONG_STATUS}, {"show_status", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_STATUS]), SHOW_LONG_STATUS}, -- cgit v1.2.1 From 5983785ef4b04b865ea1d78c8d452642913a83f3 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Tue, 29 Sep 2009 14:16:23 +0300 Subject: WL#342 heartbeat backporting from 6.0 code base to 5.1. --- sql/mysqld.cc | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7e9eb6e7291..4bbb49f47ff 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7068,6 +7068,40 @@ static int show_slave_retried_trans(THD *thd, SHOW_VAR *var, char *buff) pthread_mutex_unlock(&LOCK_active_mi); return 0; } + +static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff) +{ + pthread_mutex_lock(&LOCK_active_mi); + if (active_mi) + { + var->type= SHOW_LONGLONG; + var->value= buff; + pthread_mutex_lock(&active_mi->rli.data_lock); + *((longlong *)buff)= active_mi->received_heartbeats; + pthread_mutex_unlock(&active_mi->rli.data_lock); + } + else + var->type= SHOW_UNDEF; + pthread_mutex_unlock(&LOCK_active_mi); + return 0; +} + +static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff) +{ + pthread_mutex_lock(&LOCK_active_mi); + if (active_mi) + { + var->type= SHOW_CHAR; + var->value= buff; + my_sprintf(buff, (buff, "%.3f",active_mi->heartbeat_period)); + } + else + var->type= SHOW_UNDEF; + pthread_mutex_unlock(&LOCK_active_mi); + return 0; +} + + #endif /* HAVE_REPLICATION */ static int show_open_tables(THD *thd, SHOW_VAR *var, char *buff) @@ -7432,6 +7466,8 @@ SHOW_VAR status_vars[]= { {"Slave_open_temp_tables", (char*) &slave_open_temp_tables, SHOW_LONG}, #ifdef HAVE_REPLICATION {"Slave_retried_transactions",(char*) &show_slave_retried_trans, SHOW_FUNC}, + {"Slave_heartbeat_period", (char*) &show_heartbeat_period, SHOW_FUNC}, + {"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats, SHOW_FUNC}, {"Slave_running", (char*) &show_slave_running, SHOW_FUNC}, #endif {"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONG}, -- cgit v1.2.1 From 569ca8590c76e75a06d3ec2f320b7ea2b6960072 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 29 Sep 2009 14:38:32 +0100 Subject: BUG#44663 Unused replication options prevent server from starting. NOTE: Backporting the patch to next-mr. The use of option log_slave_updates without log_bin was preventing the server from starting. To fix the problem, we replaced the error message and the exit call by a warning message. --- sql/mysqld.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9b70096eb73..a57ee04081f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3819,9 +3819,8 @@ with --log-bin instead."); } if (opt_log_slave_updates && !opt_bin_log) { - sql_print_error("You need to use --log-bin to make " + sql_print_warning("You need to use --log-bin to make " "--log-slave-updates work."); - unireg_abort(1); } if (!opt_bin_log) { @@ -3851,11 +3850,17 @@ with --log-bin instead."); #ifdef HAVE_REPLICATION if (opt_log_slave_updates && replicate_same_server_id) { - sql_print_error("\ -using --replicate-same-server-id in conjunction with \ + if (opt_bin_log) + { + sql_print_error("using --replicate-same-server-id in conjunction with \ --log-slave-updates is impossible, it would lead to infinite loops in this \ server."); - unireg_abort(1); + unireg_abort(1); + } + else + sql_print_warning("using --replicate-same-server-id in conjunction with \ +--log-slave-updates would lead to infinite loops in this server. However this \ +will be ignored as the --log-bin option is not defined."); } #endif -- cgit v1.2.1 From b538536718389bcac283d875a7d92527d8ef57be Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 29 Sep 2009 15:10:37 +0100 Subject: Bug #30703 SHOW STATUS LIKE 'Slave_running' is not compatible with `SHOW SLAVE STATUS' NOTE: this is the backport to next-mr. SHOW SHOW STATUS LIKE 'Slave_running' command believes that if active_mi->slave_running != 0, then io thread is running normally. But it isn't so in fact. When some errors happen to make io thread try to reconnect master, then it will become transitional status (MYSQL_SLAVE_RUN_NOT_CONNECT == 1), which also doesn't equal 0. Yet, "SHOW SLAVE STATUS" believes that only if active_mi->slave_running == MYSQL_SLAVE_RUN_CONNECT, then io thread is running. So "SHOW SLAVE STATUS" can get the correct result. Fixed to make SHOW SHOW STATUS LIKE 'Slave_running' command have the same check condition with "SHOW SLAVE STATUS". It only believe that the io thread is running when active_mi->slave_running == MYSQL_SLAVE_RUN_CONNECT. --- sql/mysqld.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9b70096eb73..9ae3db4762b 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7043,7 +7043,8 @@ static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff) var->type= SHOW_MY_BOOL; pthread_mutex_lock(&LOCK_active_mi); var->value= buff; - *((my_bool *)buff)= (my_bool) (active_mi && active_mi->slave_running && + *((my_bool *)buff)= (my_bool) (active_mi && + active_mi->slave_running == MYSQL_SLAVE_RUN_CONNECT && active_mi->rli.slave_running); pthread_mutex_unlock(&LOCK_active_mi); return 0; -- cgit v1.2.1 From ba98c882728a6ea3f03566f3548c7c40a21567b3 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 29 Sep 2009 15:12:43 +0100 Subject: BUG#42928: binlog-format setting prevents server from start if binary logging is disabled NOTE: this is the backport to next-mr. If one sets binlog-format but does NOT enable binary log, server refuses to start up. The following messages appears in the error log: 090217 12:47:14 [ERROR] You need to use --log-bin to make --binlog-format work. 090217 12:47:14 [ERROR] Aborting This patch addresses this by making the server not to bail out if the binlog-format is set without the log-bin option. Additionally, the specified binlog-format is stored, in the global system variable "binlog_format", and a warning is printed instead of an error. --- sql/mysqld.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 9ae3db4762b..513302b6aec 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3827,9 +3827,10 @@ with --log-bin instead."); { if (opt_binlog_format_id != BINLOG_FORMAT_UNSPEC) { - sql_print_error("You need to use --log-bin to make " - "--binlog-format work."); - unireg_abort(1); + sql_print_warning("You need to use --log-bin to make " + "--binlog-format work."); + + global_system_variables.binlog_format= opt_binlog_format_id; } else { -- cgit v1.2.1 From 0110bd04d24503d84df93d31b444586c4137c98c Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 29 Sep 2009 15:27:12 +0100 Subject: BUG#35542 Add option to sync master and relay log to disk after every event BUG#31665 sync_binlog should cause relay logs to be synchronized NOTE: Backporting the patch to next-mr. Add sync_relay_log option to server, this option works for relay log the same as option sync_binlog for binlog. This option also synchronize master info to disk when set to non-zero value. Original patches from Sinisa and Mark, with some modifications --- sql/mysqld.cc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a57ee04081f..8febc0bb7e5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -552,7 +552,8 @@ ulong max_prepared_stmt_count; */ ulong prepared_stmt_count=0; ulong thread_id=1L,current_pid; -ulong slow_launch_threads = 0, sync_binlog_period; +ulong slow_launch_threads = 0; +uint sync_binlog_period= 0, sync_relaylog_period= 0; ulong expire_logs_days = 0; ulong rpl_recovery_rank=0; const char *log_output_str= "FILE"; @@ -5667,7 +5668,8 @@ enum options_mysqld OPT_SLAVE_EXEC_MODE, OPT_GENERAL_LOG_FILE, OPT_SLOW_QUERY_LOG_FILE, - OPT_IGNORE_BUILTIN_INNODB + OPT_IGNORE_BUILTIN_INNODB, + OPT_SYNC_RELAY_LOG }; @@ -6921,8 +6923,13 @@ The minimum value for this variable is 4096.", {"sync-binlog", OPT_SYNC_BINLOG, "Synchronously flush binary log to disk after every #th event. " "Use 0 (default) to disable synchronous flushing.", - (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_ULONG, - REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1, 0}, + (uchar**) &sync_binlog_period, (uchar**) &sync_binlog_period, 0, GET_UINT, + REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, + {"sync-relay-log", OPT_SYNC_RELAY_LOG, + "Synchronously flush relay log to disk after every #th event. " + "Use 0 (default) to disable synchronous flushing.", + (uchar**) &sync_relaylog_period, (uchar**) &sync_relaylog_period, 0, GET_UINT, + REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.", (uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, -- cgit v1.2.1 From 3ab71376ceb2d5da81d3b6fb092630d0b0929d76 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 29 Sep 2009 15:40:52 +0100 Subject: BUG#40337 Fsyncing master and relay log to disk after every event is too slow NOTE: Backporting the patch to next-mr. The fix proposed in BUG#35542 and BUG#31665 introduces a performance issue when fsyncing the master.info, relay.info and relay-log.bin* after #th events. Although such solution has been proposed to reduce the probability of corrupted files due to a slave-crash, the performance penalty introduced by it has made the approach impractical for highly intensive workloads. In a nutshell, the option --syn-relay-log proposed in BUG#35542 and BUG#31665 simultaneously fsyncs master.info, relay-log.info and relay-log.bin* and this is the main source of performance issues. This patch introduces new options that give more control to the user on what should be fsynced and how often: 1) (--sync-master-info, integer) which syncs the master.info after #th event; 2) (--sync-relay-log, integer) which syncs the relay-log.bin* after #th events. 3) (--sync-relay-log-info, integer) which syncs the relay.info after #th transactions. To provide both performance and increased reliability, we recommend the following setup: 1) --sync-master-info = 0 eventually the operating system will fsync it; 2) --sync-relay-log = 0 eventually the operating system will fsync it; 3) --sync-relay-log-info = 1 fsyncs it after every transaction; Notice, that the previous setup does not reduce the probability of corrupted master.info and relay-log.bin*. To overcome the issue, this patch also introduces a recovery mechanism that right after restart throws away relay-log.bin* retrieved from a master and updates the master.info based on the relay.info: 4) (--relay-log-recovery, boolean) which enables a recovery mechanism that throws away relay-log.bin* after a crash. However, it can only recover the incorrect binlog file and position in master.info, if other informations (host, port password, etc) are corrupted or incorrect, then this recovery mechanism will fail to work. --- sql/mysqld.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 8febc0bb7e5..b8d09fd4e5a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -477,6 +477,7 @@ extern const char *opt_ndb_distribution; extern enum ndb_distribution opt_ndb_distribution_id; #endif my_bool opt_readonly, use_temp_pool, relay_log_purge; +my_bool relay_log_recovery; my_bool opt_sync_frm, opt_allow_suspicious_udfs; my_bool opt_secure_auth= 0; char* opt_secure_file_priv= 0; @@ -553,7 +554,8 @@ ulong max_prepared_stmt_count; ulong prepared_stmt_count=0; ulong thread_id=1L,current_pid; ulong slow_launch_threads = 0; -uint sync_binlog_period= 0, sync_relaylog_period= 0; +uint sync_binlog_period= 0, sync_relaylog_period= 0, + sync_relayloginfo_period= 0, sync_masterinfo_period= 0; ulong expire_logs_days = 0; ulong rpl_recovery_rank=0; const char *log_output_str= "FILE"; @@ -5605,6 +5607,7 @@ enum options_mysqld OPT_QUERY_CACHE_TYPE, OPT_QUERY_CACHE_WLOCK_INVALIDATE, OPT_RECORD_BUFFER, OPT_RECORD_RND_BUFFER, OPT_DIV_PRECINCREMENT, OPT_RELAY_LOG_SPACE_LIMIT, OPT_RELAY_LOG_PURGE, + OPT_RELAY_LOG_RECOVERY, OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME, OPT_SLAVE_TRANS_RETRIES, OPT_READONLY, OPT_DEBUGGING, OPT_SORT_BUFFER, OPT_TABLE_OPEN_CACHE, OPT_TABLE_DEF_CACHE, @@ -5669,7 +5672,9 @@ enum options_mysqld OPT_GENERAL_LOG_FILE, OPT_SLOW_QUERY_LOG_FILE, OPT_IGNORE_BUILTIN_INNODB, - OPT_SYNC_RELAY_LOG + OPT_SYNC_RELAY_LOG, + OPT_SYNC_RELAY_LOG_INFO, + OPT_SYNC_MASTER_INFO }; @@ -6889,6 +6894,13 @@ The minimum value for this variable is 4096.", (uchar**) &relay_log_purge, (uchar**) &relay_log_purge, 0, GET_BOOL, NO_ARG, 1, 0, 1, 0, 1, 0}, + {"relay_log_recovery", OPT_RELAY_LOG_RECOVERY, + "Enables automatic relay log recovery right after the database startup, " + "which means that the IO Thread starts re-fetching from the master " + "right after the last transaction processed.", + (uchar**) &relay_log_recovery, + (uchar**) &relay_log_recovery, 0, GET_BOOL, NO_ARG, + 0, 0, 1, 0, 1, 0}, {"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT, "Maximum space to use for all relay logs.", (uchar**) &relay_log_space_limit, @@ -6930,6 +6942,16 @@ The minimum value for this variable is 4096.", "Use 0 (default) to disable synchronous flushing.", (uchar**) &sync_relaylog_period, (uchar**) &sync_relaylog_period, 0, GET_UINT, REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, + {"sync-relay-log-info", OPT_SYNC_RELAY_LOG_INFO, + "Synchronously flush relay log info to disk after #th transaction. " + "Use 0 (default) to disable synchronous flushing.", + (uchar**) &sync_relayloginfo_period, (uchar**) &sync_relayloginfo_period, 0, GET_UINT, + REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, + {"sync-master-info", OPT_SYNC_MASTER_INFO, + "Synchronously flush master info to disk after every #th event. " + "Use 0 (default) to disable synchronous flushing.", + (uchar**) &sync_masterinfo_period, (uchar**) &sync_masterinfo_period, 0, GET_UINT, + REQUIRED_ARG, 0, 0, (longlong) UINT_MAX, 0, 1, 0}, {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default.", (uchar**) &opt_sync_frm, (uchar**) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, -- cgit v1.2.1 From 14c2cfb568e081ef66e4b6aadfc9611dd0f4be88 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 30 Sep 2009 17:40:12 +0200 Subject: Backport of this changeset http://lists.mysql.com/commits/59686 Cleanup pthread_self(), pthread_create(), pthread_join() implementation on Windows. Prior implementation is was unnecessarily complicated and even differs in embedded and non-embedded case. Improvements in this patch: * pthread_t is now the unique thread ID, instead of HANDLE returned by beginthread This simplifies pthread_self() to be just straight GetCurrentThreadId(). prior it was much art involved in passing the beginthread() handle from the caller to the TLS structure in the child thread ( did not work for the main thread of course) * remove MySQL specific my_thread_init()/my_thread_end() from pthread_create. No automagic is done on Unix on pthread_create(). Having the same on Windows will improve portability and avoid extra #ifdef's * remove redefinition of getpid() - it was defined as GetCurrentThreadId() --- sql/mysqld.cc | 60 ++++++++++++++++++++--------------------------------------- 1 file changed, 20 insertions(+), 40 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index bb79f931fb3..3585539318d 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -805,7 +805,10 @@ static void set_server_version(void); static int init_thread_environment(); static char *get_relative_path(const char *path); static int fix_paths(void); -pthread_handler_t handle_connections_sockets(void *arg); +void handle_connections_sockets(); +#ifdef _WIN32 +pthread_handler_t handle_connections_sockets_thread(void *arg); +#endif pthread_handler_t kill_server_thread(void *arg); static void bootstrap(FILE *file); static bool read_init_file(char *file_name); @@ -2034,29 +2037,7 @@ static BOOL WINAPI console_event_handler( DWORD type ) } -/* - In Visual Studio 2005 and later, default SIGABRT handler will overwrite - any unhandled exception filter set by the application and will try to - call JIT debugger. This is not what we want, this we calling __debugbreak - to stop in debugger, if process is being debugged or to generate - EXCEPTION_BREAKPOINT and then handle_segfault will do its magic. -*/ - -#if (_MSC_VER >= 1400) -static void my_sigabrt_handler(int sig) -{ - __debugbreak(); -} -#endif /*_MSC_VER >=1400 */ -void win_install_sigabrt_handler(void) -{ -#if (_MSC_VER >=1400) - /*abort() should not override our exception filter*/ - _set_abort_behavior(0,_CALL_REPORTFAULT); - signal(SIGABRT,my_sigabrt_handler); -#endif /* _MSC_VER >=1400 */ -} #ifdef DEBUG_UNHANDLED_EXCEPTION_FILTER #define DEBUGGER_ATTACH_TIMEOUT 120 @@ -2135,7 +2116,6 @@ LONG WINAPI my_unhandler_exception_filter(EXCEPTION_POINTERS *ex_pointers) static void init_signals(void) { - win_install_sigabrt_handler(); if(opt_console) SetConsoleCtrlHandler(console_event_handler,TRUE); @@ -4132,7 +4112,8 @@ static void create_shutdown_thread() #ifdef __WIN__ hEventShutdown=CreateEvent(0, FALSE, FALSE, shutdown_event_name); pthread_t hThread; - if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0)) + if (pthread_create(&hThread,&connection_attrib, + handle_connections_sockets_thread, 0)) sql_print_warning("Can't create thread to handle shutdown requests"); // On "Stop Service" we have to do regular shutdown @@ -4177,7 +4158,7 @@ static void handle_connections_methods() { handler_count++; if (pthread_create(&hThread,&connection_attrib, - handle_connections_sockets, 0)) + handle_connections_sockets_thread, 0)) { sql_print_warning("Can't create thread to handle TCP/IP"); handler_count--; @@ -4506,18 +4487,11 @@ we force server id to 2, but this MySQL server will not act as a slave."); pthread_cond_signal(&COND_server_started); pthread_mutex_unlock(&LOCK_server_started); -#if defined(__NT__) || defined(HAVE_SMEM) +#if defined(_WIN32) || defined(HAVE_SMEM) handle_connections_methods(); #else -#ifdef __WIN__ - if (!have_tcpip || opt_disable_networking) - { - sql_print_error("TCP/IP unavailable or disabled with --skip-networking; no available interfaces"); - unireg_abort(1); - } -#endif - handle_connections_sockets(0); -#endif /* __NT__ */ + handle_connections_sockets(); +#endif /* _WIN32 || HAVE_SMEM */ /* (void) pthread_attr_destroy(&connection_attrib); */ @@ -4992,7 +4966,7 @@ inline void kill_broken_server() /* Handle new connections and spawn new process to handle them */ #ifndef EMBEDDED_LIBRARY -pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused))) +void handle_connections_sockets() { my_socket sock,new_sock; uint error_count=0; @@ -5195,13 +5169,19 @@ pthread_handler_t handle_connections_sockets(void *arg __attribute__((unused))) create_new_thread(thd); } + DBUG_VOID_RETURN; +} + +#ifdef _WIN32 +pthread_handler_t handle_connections_sockets_thread(void *arg) +{ + my_thread_init(); + handle_connections_sockets(); decrement_handler_count(); - DBUG_RETURN(0); + return 0; } - -#ifdef __NT__ pthread_handler_t handle_connections_namedpipes(void *arg) { HANDLE hConnectedPipe; -- cgit v1.2.1 From 4acaca0202ccf1beb553a670121a25b15965be59 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Wed, 30 Sep 2009 22:10:22 +0200 Subject: backport of Revision: 2597.72.1 revid:sp1r-Reggie@core.-20080403153947-15243 removed instances of __NT__ from code. We now only build "NT" binaries --- sql/mysqld.cc | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 3585539318d..e2d4de4dc56 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -732,7 +732,7 @@ static NTService Service; ///< Service object for WinNT #endif /* EMBEDDED_LIBRARY */ #endif /* __WIN__ */ -#ifdef __NT__ +#ifdef _WIN32 static char pipe_name[512]; static SECURITY_ATTRIBUTES saPipeSecurity; static SECURITY_DESCRIPTOR sdPipeDescriptor; @@ -812,7 +812,7 @@ pthread_handler_t handle_connections_sockets_thread(void *arg); pthread_handler_t kill_server_thread(void *arg); static void bootstrap(FILE *file); static bool read_init_file(char *file_name); -#ifdef __NT__ +#ifdef _WIN32 pthread_handler_t handle_connections_namedpipes(void *arg); #endif #ifdef HAVE_SMEM @@ -898,7 +898,7 @@ static void close_connections(void) ip_sock= INVALID_SOCKET; } } -#ifdef __NT__ +#ifdef _WIN32 if (hPipe != INVALID_HANDLE_VALUE && opt_enable_named_pipe) { HANDLE temp; @@ -1690,7 +1690,7 @@ static void network_init(void) } } -#ifdef __NT__ +#ifdef _WIN32 /* create named pipe */ if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap && opt_enable_named_pipe) @@ -4124,12 +4124,11 @@ static void create_shutdown_thread() #endif /* EMBEDDED_LIBRARY */ -#if (defined(__NT__) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) static void handle_connections_methods() { pthread_t hThread; DBUG_ENTER("handle_connections_methods"); -#ifdef __NT__ if (hPipe == INVALID_HANDLE_VALUE && (!have_tcpip || opt_disable_networking) && !opt_enable_shared_memory) @@ -4137,12 +4136,10 @@ static void handle_connections_methods() sql_print_error("TCP/IP, --shared-memory, or --named-pipe should be configured on NT OS"); unireg_abort(1); // Will not return } -#endif pthread_mutex_lock(&LOCK_thread_count); (void) pthread_cond_init(&COND_handler_count,NULL); handler_count=0; -#ifdef __NT__ if (hPipe != INVALID_HANDLE_VALUE) { handler_count++; @@ -4153,7 +4150,6 @@ static void handle_connections_methods() handler_count--; } } -#endif /* __NT__ */ if (have_tcpip && !opt_disable_networking) { handler_count++; @@ -4193,7 +4189,7 @@ void decrement_handler_count() } #else #define decrement_handler_count() -#endif /* defined(__NT__) || defined(HAVE_SMEM) */ +#endif /* defined(_WIN32) || defined(HAVE_SMEM) */ #ifndef EMBEDDED_LIBRARY @@ -5261,7 +5257,7 @@ pthread_handler_t handle_connections_namedpipes(void *arg) decrement_handler_count(); DBUG_RETURN(0); } -#endif /* __NT__ */ +#endif /* _WIN32 */ #ifdef HAVE_SMEM @@ -5837,7 +5833,7 @@ struct my_option my_long_options[] = "Deprecated option, use --external-locking instead.", (uchar**) &opt_external_locking, (uchar**) &opt_external_locking, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, -#ifdef __NT__ +#ifdef _WIN32 {"enable-named-pipe", OPT_HAVE_NAMED_PIPE, "Enable the named pipe (NT).", (uchar**) &opt_enable_named_pipe, (uchar**) &opt_enable_named_pipe, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, -- cgit v1.2.1 From 21916790a1d15a20d9c823c1230505941762fc12 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Tue, 6 Oct 2009 14:57:07 +0400 Subject: Backport WL#4085: Merge revno:2617.56.29 from 6.0. --- sql/mysqld.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e2d4de4dc56..422927f7fda 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7499,10 +7499,7 @@ SHOW_VAR status_vars[]= { static void print_version(void) { set_server_version(); - /* - Note: the instance manager keys off the string 'Ver' so it can find the - version from the output of 'mysqld --version', so don't change it! - */ + printf("%s Ver %s for %s on %s (%s)\n",my_progname, server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT); } -- cgit v1.2.1 From 9dff84347d6cb758c0027501c58345ef877773a3 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Fri, 9 Oct 2009 13:06:41 +0400 Subject: Backport to 5.4 the following changesets: revno: 2476.785.24 committer: kostja@bodhi.(none) timestamp: Tue 2007-10-16 20:19:00 +0400 message: Reflect a rename of a member in the client ABI (a compatible change). ---------------------------------------------------------- revno: 2476.423.26 committer: kostja@bodhi.(none) timestamp: Tue 2007-10-16 20:12:37 +0400 message: Update the client ABI to reflect member rename (this is a backward-compatible change). ---------------------------------------------------------- revno: 2476.785.22 committer: kostja@bodhi.(none) timestamp: Tue 2007-10-16 19:37:25 +0400 message: Remove some remains of support of 3.22 protocol. This was in fact dead code, since the option to talk 3.22 protocol was removed in 4.1 and there is no other protocol negotiation mechanism besides this option. include/mysql.h.pp: Update ABI. include/mysql_com.h: Remove an unused 3.22 protocol member. sql/field.cc: Remove an unused 3.22 protocol check. sql/mysqld.cc: Remove an unused 3.22 protocol check. sql/net_serv.cc: Remove an unused 3.22 protocol variable initialization. sql/protocol.cc: Remove an unused 3.22 protocol check. --- sql/mysqld.cc | 3 --- 1 file changed, 3 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e2d4de4dc56..0e76b5f5658 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4892,9 +4892,6 @@ static void create_new_thread(THD *thd) NET *net=&thd->net; DBUG_ENTER("create_new_thread"); - if (protocol_version > 9) - net->return_errno=1; - /* Don't allow too many connections. We roughly check here that we allow only (max_connections + 1) connections. -- cgit v1.2.1 From 0da357645c41867552481b18b7de12806f743fe0 Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Fri, 9 Oct 2009 15:59:25 +0200 Subject: Bug #44651 "have_community_features" variable should be renamed "have_profiling" 1) Renamed have_community_features server system variable to have_profiling. 2) Removed eable-community-features configure option and ENABLE_COMMUNITY_FEATURES macro. 3) Removed COMMUNITY_SERVER macro and replaced its usage by ENABLED_PROFILING. Only --enable-profiling is now needed to enable profiling. It was the only existing "community feature", so there was no need for both configure options. Using --enable-community-features will give a warning message since it no longer exists. --- sql/mysqld.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 0e76b5f5658..78faaccf881 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -635,7 +635,7 @@ MY_LOCALE *my_default_lc_time_names; SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache; SHOW_COMP_OPTION have_geometry, have_rtree_keys; SHOW_COMP_OPTION have_crypt, have_compress; -SHOW_COMP_OPTION have_community_features; +SHOW_COMP_OPTION have_profiling; /* Thread specific variables */ @@ -6230,7 +6230,7 @@ master-ssl", "Maximum time in seconds to wait for the port to become free. " "(Default: no wait)", (uchar**) &mysqld_port_timeout, (uchar**) &mysqld_port_timeout, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, -#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER) +#if defined(ENABLED_PROFILING) {"profiling_history_size", OPT_PROFILING, "Limit of query profiling memory", (uchar**) &global_system_variables.profiling_history_size, (uchar**) &max_system_variables.profiling_history_size, @@ -7028,7 +7028,7 @@ static int show_starttime(THD *thd, SHOW_VAR *var, char *buff) return 0; } -#ifdef COMMUNITY_SERVER +#ifdef ENABLED_PROFILING static int show_flushstatustime(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_LONG; @@ -7486,7 +7486,7 @@ SHOW_VAR status_vars[]= { {"Threads_created", (char*) &thread_created, SHOW_LONG_NOFLUSH}, {"Threads_running", (char*) &thread_running, SHOW_INT}, {"Uptime", (char*) &show_starttime, SHOW_FUNC}, -#ifdef COMMUNITY_SERVER +#ifdef ENABLED_PROFILING {"Uptime_since_flush_status",(char*) &show_flushstatustime, SHOW_FUNC}, #endif {NullS, NullS, SHOW_LONG} @@ -7719,10 +7719,10 @@ static int mysql_init_variables(void) "d:t:i:o,/tmp/mysqld.trace"); #endif opt_error_log= IF_WIN(1,0); -#ifdef COMMUNITY_SERVER - have_community_features = SHOW_OPTION_YES; +#ifdef ENABLED_PROFILING + have_profiling = SHOW_OPTION_YES; #else - have_community_features = SHOW_OPTION_NO; + have_profiling = SHOW_OPTION_NO; #endif global_system_variables.ndb_index_stat_enable=FALSE; max_system_variables.ndb_index_stat_enable=TRUE; @@ -8826,9 +8826,7 @@ void refresh_status(THD *thd) /* Reset the counters of all key caches (default and named). */ process_key_caches(reset_key_cache_counters); -#ifdef COMMUNITY_SERVER flush_status_time= time((time_t*) 0); -#endif pthread_mutex_unlock(&LOCK_status); /* -- cgit v1.2.1 From 9a65687bd9e76783d3e34cb35b5c8cc05421134d Mon Sep 17 00:00:00 2001 From: Magne Mahre Date: Mon, 12 Oct 2009 15:35:30 +0200 Subject: Bug #33693 general log name and location depend on PID file, not on predefined values The default name of the PID file was constructed, as documented, based on the hostname. This name was subsequently used as the base for the general log file name. If the name of the PID file was overridden in the configuration, and no explicit name was set for the general log file, the path location for the PID file was used also for the general log file. A new variable, 'default_logfile_name', has been introduced. This name is constructed based on the hostname, and is then used to construct both the PID file and the general log file. The general log file will now, unless explicitly set, be located in the server data directory (as documentated in the server docs) mysql-test/t/log_state.test: run/mysqld.log was created as a consequence of this bug. After the fix it is no longer created, and will thus not be deleted. --- sql/mysqld.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 78faaccf881..580842c944e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -572,6 +572,7 @@ const char *log_output_str= "FILE"; time_t server_start_time, flush_status_time; char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30]; +char default_logfile_name[FN_REFLEN]; char *default_tz_name; char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN]; char mysql_real_data_home[FN_REFLEN], @@ -3168,10 +3169,13 @@ static int init_common_variables(const char *conf_file_name, int argc, strmake(glob_hostname, STRING_WITH_LEN("localhost")); sql_print_warning("gethostname failed, using '%s' as hostname", glob_hostname); - strmake(pidfile_name, STRING_WITH_LEN("mysql")); + strmake(default_logfile_name, STRING_WITH_LEN("mysql")); } else - strmake(pidfile_name, glob_hostname, sizeof(pidfile_name)-5); + strmake(default_logfile_name, glob_hostname, + sizeof(default_logfile_name)-5); + + strmake(pidfile_name, default_logfile_name, sizeof(pidfile_name)-5); strmov(fn_ext(pidfile_name),".pid"); // Add proper extension /* -- cgit v1.2.1 From c0c7925cae8ae111e4d7a01e3e32712a74812d7b Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Wed, 14 Oct 2009 15:34:20 +0400 Subject: Backport of: ---------------------------------------------------------- revno: 2630.22.31 committer: Konstantin Osipov branch nick: mysql-6.0-runtime timestamp: Thu 2008-10-02 19:08:09 +0400 message: Bug #34818 --default-table-type option should be removed Remove the deprecated option. sql/mysqld.cc: Remove a deprecated option. --- sql/mysqld.cc | 4 ---- 1 file changed, 4 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 580842c944e..47895522626 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -5805,10 +5805,6 @@ struct my_option my_long_options[] = "Set the default storage engine (table type) for tables.", (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, - {"default-table-type", OPT_STORAGE_ENGINE, - "(deprecated) Use --default-storage-engine.", - (uchar**)&default_storage_engine_str, (uchar**)&default_storage_engine_str, - 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"default-time-zone", OPT_DEFAULT_TIME_ZONE, "Set the default time zone.", (uchar**) &default_tz_name, (uchar**) &default_tz_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, -- cgit v1.2.1 From 2b75d952e68375eb1727040074266bbe1b436653 Mon Sep 17 00:00:00 2001 From: Konstantin Osipov Date: Wed, 14 Oct 2009 18:07:50 +0400 Subject: Backport of: ---------------------------------------------------------- revno: 2630.28.1 committer: Konstantin Osipov branch nick: mysql-6.0-runtime timestamp: Thu 2008-10-23 15:23:44 +0400 message: Bug#32738 "mysqld: Two slow log option/variable descriptions are inaccurate" Update option description per suggestion from the documentation team. sql/mysqld.cc: Update options help texts (Bug#32738). Use - instead of _ in option names. --- sql/mysqld.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 47895522626..e21453ce15c 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3454,7 +3454,7 @@ static int init_common_variables(const char *conf_file_name, int argc, if (opt_slow_log && opt_slow_logname && !(log_output_options & LOG_FILE) && !(log_output_options & LOG_NONE)) sql_print_warning("Although a path was specified for the " - "--log_slow_queries option, log tables are used. " + "--log-slow-queries option, log tables are used. " "To enable logging to files use the --log-output=file option."); s= opt_logname ? opt_logname : make_default_log_name(buff, ".log"); @@ -5985,14 +5985,14 @@ Disable with --skip-super-large-pages.", (uchar**) &opt_log_slow_slave_statements, (uchar**) &opt_log_slow_slave_statements, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, - {"log_slow_queries", OPT_SLOW_QUERY_LOG, - "Log slow queries to a table or log file. Defaults logging to table " - "mysql.slow_log or hostname-slow.log if --log-output=file is used. " - "Must be enabled to activate other slow log options. " - "(deprecated option, use --slow_query_log/--slow_query_log_file instead)", + {"log-slow-queries", OPT_SLOW_QUERY_LOG, + "Log slow queries to a table or log file. Defaults logging to table " + "mysql.slow_log or hostname-slow.log if --log-output=file is used. " + "Must be enabled to activate other slow log options. " + "Deprecated option, use --slow-query-log/--slow-query-log-file instead.", (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, - {"slow_query_log_file", OPT_SLOW_QUERY_LOG_FILE, + {"slow-query-log-file", OPT_SLOW_QUERY_LOG_FILE, "Log slow queries to given log file. Defaults logging to hostname-slow.log. Must be enabled to activate other slow log options.", (uchar**) &opt_slow_logname, (uchar**) &opt_slow_logname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -6705,7 +6705,7 @@ The minimum value for this variable is 4096.", (uchar**) &max_write_lock_count, (uchar**) &max_write_lock_count, 0, GET_ULONG, REQUIRED_ARG, ULONG_MAX, 1, ULONG_MAX, 0, 1, 0}, {"min_examined_row_limit", OPT_MIN_EXAMINED_ROW_LIMIT, - "Don't log queries which examine less than min_examined_row_limit rows to file.", + "Don't write queries to slow log that examine fewer than min_examined_row_limit rows.", (uchar**) &global_system_variables.min_examined_row_limit, (uchar**) &max_system_variables.min_examined_row_limit, 0, GET_ULONG, REQUIRED_ARG, 0, 0, ULONG_MAX, 0, 1L, 0}, @@ -7840,7 +7840,7 @@ mysqld_get_one_option(int optid, default_collation_name= 0; break; case 'l': - WARN_DEPRECATED(NULL, "7.0", "--log", "'--general_log'/'--general_log_file'"); + WARN_DEPRECATED(NULL, "7.0", "--log", "'--general-log'/'--general-log-file'"); opt_log=1; break; case 'h': @@ -8014,7 +8014,8 @@ mysqld_get_one_option(int optid, } #endif /* HAVE_REPLICATION */ case (int) OPT_SLOW_QUERY_LOG: - WARN_DEPRECATED(NULL, "7.0", "--log_slow_queries", "'--slow_query_log'/'--slow_query_log_file'"); + WARN_DEPRECATED(NULL, "7.0", "--log-slow-queries", + "'--slow-query-log'/'--slow-query-log-file'"); opt_slow_log= 1; break; #ifdef WITH_CSV_STORAGE_ENGINE -- cgit v1.2.1 From 3c557833205a44e08b72d47db53054562907cc78 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Thu, 15 Oct 2009 05:18:52 +0200 Subject: Bug #48047 Can't do normal shutdown Fix a regression that crept in when downporting Windows improvements. Instead of a shutdown thread, another thread that handledsocket connection was created. --- sql/mysqld.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e2d4de4dc56..612aeafce48 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4112,8 +4112,7 @@ static void create_shutdown_thread() #ifdef __WIN__ hEventShutdown=CreateEvent(0, FALSE, FALSE, shutdown_event_name); pthread_t hThread; - if (pthread_create(&hThread,&connection_attrib, - handle_connections_sockets_thread, 0)) + if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0)) sql_print_warning("Can't create thread to handle shutdown requests"); // On "Stop Service" we have to do regular shutdown -- cgit v1.2.1 From d8c3f2263f3deaadff957a0047460e8058cffccf Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Thu, 15 Oct 2009 17:23:43 +0500 Subject: WL#751 Error message construction, backport --- sql/mysqld.cc | 71 +++++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 26 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 422927f7fda..cfcc6d3b96a 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -399,9 +399,10 @@ static const char *optimizer_switch_str="index_merge=on,index_merge_union=on," "index_merge_sort_union=on," "index_merge_intersection=on"; static char *mysqld_user, *mysqld_chroot, *log_error_file_ptr; -static char *opt_init_slave, *language_ptr, *opt_init_connect; +static char *opt_init_slave, *lc_messages_dir_ptr, *opt_init_connect; static char *default_character_set_name; static char *character_set_filesystem_name; +static char *lc_messages; static char *lc_time_names_name; static char *my_bind_addr_str; static char *default_collation_name; @@ -575,9 +576,11 @@ char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30]; char *default_tz_name; char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN]; char mysql_real_data_home[FN_REFLEN], - language[FN_REFLEN], reg_ext[FN_EXTLEN], mysql_charsets_dir[FN_REFLEN], + lc_messages_dir[FN_REFLEN], reg_ext[FN_EXTLEN], + mysql_charsets_dir[FN_REFLEN], *opt_init_file, *opt_tc_log_file, def_ft_boolean_syntax[sizeof(ft_boolean_syntax)]; +char err_shared_dir[FN_REFLEN]; char mysql_unpacked_real_data_home[FN_REFLEN]; int mysql_unpacked_real_data_home_len; uint reg_ext_length; @@ -590,7 +593,6 @@ uint mysql_data_home_len; char mysql_data_home_buff[2], *mysql_data_home=mysql_real_data_home; char server_version[SERVER_VERSION_LENGTH]; char *mysqld_unix_port, *opt_mysql_tmpdir; -const char **errmesg; /**< Error messages */ const char *myisam_recover_options_str="OFF"; const char *myisam_stats_method_str="nulls_unequal"; @@ -630,6 +632,7 @@ CHARSET_INFO *national_charset_info, *table_alias_charset; CHARSET_INFO *character_set_filesystem; CHARSET_INFO *error_message_charset_info; +MY_LOCALE *my_default_lc_messages; MY_LOCALE *my_default_lc_time_names; SHOW_COMP_OPTION have_ssl, have_symlink, have_dlopen, have_query_cache; @@ -648,7 +651,7 @@ pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count, LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received, LOCK_global_system_variables, LOCK_user_conn, LOCK_slave_list, LOCK_active_mi, - LOCK_connection_count; + LOCK_connection_count, LOCK_error_messages; /** The below lock protects access to two global server variables: max_prepared_stmt_count and prepared_stmt_count. These variables @@ -1143,9 +1146,9 @@ static void __cdecl kill_server(int sig_ptr) if (sig != 0) // 0 is not a valid signal number my_sigset(sig, SIG_IGN); /* purify inspected */ if (sig == MYSQL_KILL_SIGNAL || sig == 0) - sql_print_information(ER(ER_NORMAL_SHUTDOWN),my_progname); + sql_print_information(ER_DEFAULT(ER_NORMAL_SHUTDOWN),my_progname); else - sql_print_error(ER(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */ + sql_print_error(ER_DEFAULT(ER_GOT_SIGNAL),my_progname,sig); /* purecov: inspected */ #if defined(HAVE_SMEM) && defined(__WIN__) /* @@ -1344,12 +1347,11 @@ void clean_up(bool print_message) if (!opt_bootstrap) (void) my_delete(pidfile_name,MYF(0)); // This may not always exist #endif - if (print_message && errmesg && server_start_time) - sql_print_information(ER(ER_SHUTDOWN_COMPLETE),my_progname); + if (print_message && /*errmesg &&*/ server_start_time) + sql_print_information(ER_DEFAULT(ER_SHUTDOWN_COMPLETE),my_progname); + cleanup_errmsgs(); thread_scheduler.end(); finish_client_errs(); - my_free((uchar*) my_error_unregister(ER_ERROR_FIRST, ER_ERROR_LAST), - MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); DBUG_PRINT("quit", ("Error messages freed")); /* Tell main we are ready */ logger.cleanup_end(); @@ -1433,6 +1435,7 @@ static void clean_up_mutexes() (void) pthread_mutex_destroy(&LOCK_global_read_lock); (void) pthread_mutex_destroy(&LOCK_uuid_generator); (void) pthread_mutex_destroy(&LOCK_prepared_stmt_count); + (void) pthread_mutex_destroy(&LOCK_error_messages); (void) pthread_cond_destroy(&COND_thread_count); (void) pthread_cond_destroy(&COND_refresh); (void) pthread_cond_destroy(&COND_global_read_lock); @@ -1805,7 +1808,7 @@ void close_connection(THD *thd, uint errcode, bool lock) DBUG_PRINT("enter",("fd: %s error: '%s'", thd->net.vio ? vio_description(thd->net.vio) : "(not connected)", - errcode ? ER(errcode) : "")); + errcode ? ER_DEFAULT(errcode) : "")); if (lock) (void) pthread_mutex_lock(&LOCK_thread_count); thd->killed= THD::KILL_CONNECTION; @@ -1813,7 +1816,7 @@ void close_connection(THD *thd, uint errcode, bool lock) { if (errcode) net_send_error(thd, errcode, - ER(errcode), NULL); /* purecov: inspected */ + ER_DEFAULT(errcode), NULL); /* purecov: inspected */ vio_close(vio); /* vio is freed in delete thd */ } if (lock) @@ -3343,6 +3346,13 @@ static int init_common_variables(const char *conf_file_name, int argc, open_files_limit= files; } unireg_init(opt_specialflag); /* Set up extern variabels */ + if (!(my_default_lc_messages= + my_locale_by_name(lc_messages))) + { + sql_print_error("Unknown locale: '%s'", lc_messages); + return 1; + } + global_system_variables.lc_messages= my_default_lc_messages; if (init_errmessage()) /* Read error messages from file */ return 1; init_client_errs(); @@ -3393,12 +3403,12 @@ static int init_common_variables(const char *conf_file_name, int argc, default_collation= get_charset_by_name(default_collation_name, MYF(0)); if (!default_collation) { - sql_print_error(ER(ER_UNKNOWN_COLLATION), default_collation_name); + sql_print_error(ER_DEFAULT(ER_UNKNOWN_COLLATION), default_collation_name); return 1; } if (!my_charset_same(default_charset_info, default_collation)) { - sql_print_error(ER(ER_COLLATION_CHARSET_MISMATCH), + sql_print_error(ER_DEFAULT(ER_COLLATION_CHARSET_MISMATCH), default_collation_name, default_charset_info->csname); return 1; @@ -3546,6 +3556,7 @@ static int init_thread_environment() (void) my_rwlock_init(&LOCK_system_variables_hash, NULL); (void) pthread_mutex_init(&LOCK_global_read_lock, MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_prepared_stmt_count, MY_MUTEX_INIT_FAST); + (void) pthread_mutex_init(&LOCK_error_messages, MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_connection_count, MY_MUTEX_INIT_FAST); #ifdef HAVE_OPENSSL @@ -3952,8 +3963,8 @@ server."); } /* if the errmsg.sys is not loaded, terminate to maintain behaviour */ - if (!errmesg[0][0]) - unireg_abort(1); + if (!DEFAULT_ERRMSGS[0][0]) + unireg_abort(1); /* We have to initialize the storage engines before CSV logging */ if (ha_init()) @@ -4467,7 +4478,7 @@ we force server id to 2, but this MySQL server will not act as a slave."); create_shutdown_thread(); start_handle_manager(); - sql_print_information(ER(ER_STARTUP),my_progname,server_version, + sql_print_information(ER_DEFAULT(ER_STARTUP),my_progname,server_version, ((unix_sock == INVALID_SOCKET) ? (char*) "" : mysqld_unix_port), mysqld_port, @@ -5628,6 +5639,7 @@ enum options_mysqld OPT_DEFAULT_COLLATION, OPT_CHARACTER_SET_CLIENT_HANDSHAKE, OPT_CHARACTER_SET_FILESYSTEM, + OPT_LC_ERROR_MESSAGES, OPT_LC_TIME_NAMES, OPT_INIT_CONNECT, OPT_INIT_SLAVE, @@ -5896,9 +5908,17 @@ Disable with --skip-super-large-pages.", (uchar**) &opt_init_slave, (uchar**) &opt_init_slave, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"language", 'L', - "Client error messages in given language. May be given as a full path.", - (uchar**) &language_ptr, (uchar**) &language_ptr, 0, GET_STR, REQUIRED_ARG, - 0, 0, 0, 0, 0, 0}, + "Client error messages in given language. May be given as a full path. " + "Deprecated. Use --lc-messages-dir instead.", + (uchar**) &lc_messages_dir_ptr, (uchar**) &lc_messages_dir_ptr, 0, + GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"lc-messages-dir", 'L', + "Directory where error messages are.", (uchar**) &lc_messages_dir_ptr, + (uchar**) &lc_messages_dir_ptr, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"lc-messages", OPT_LC_ERROR_MESSAGES, + "Set the language used for the error messages.", + (uchar**) &lc_messages, (uchar**) &lc_messages, 0, GET_STR, REQUIRED_ARG, + 0, 0, 0, 0, 0, 0 }, {"lc-time-names", OPT_LC_TIME_NAMES, "Set the language used for the month names and the days of the week.", (uchar**) &lc_time_names_name, @@ -7616,7 +7636,6 @@ static int mysql_init_variables(void) max_used_connections= slow_launch_threads = 0; mysqld_user= mysqld_chroot= opt_init_file= opt_bin_logname = 0; prepared_stmt_count= 0; - errmesg= 0; mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS; bzero((uchar*) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list)); bzero((char *) &global_status_var, sizeof(global_status_var)); @@ -7646,7 +7665,7 @@ static int mysql_init_variables(void) mysql_home_ptr= mysql_home; pidfile_name_ptr= pidfile_name; log_error_file_ptr= log_error_file; - language_ptr= language; + lc_messages_dir_ptr= lc_messages_dir; mysql_data_home= mysql_real_data_home; thd_startup_options= (OPTION_AUTO_IS_NULL | OPTION_BIN_LOG | OPTION_QUOTE_SHOW_CREATE | OPTION_SQL_NOTES); @@ -7671,7 +7690,6 @@ static int mysql_init_variables(void) multi_keycache_init(); /* Set directory paths */ - strmake(language, LANGUAGE, sizeof(language)-1); strmake(mysql_real_data_home, get_relative_path(MYSQL_DATADIR), sizeof(mysql_real_data_home)-1); mysql_data_home_buff[0]=FN_CURLIB; // all paths are relative from here @@ -7694,6 +7712,7 @@ static int mysql_init_variables(void) default_collation_name= compiled_default_collation_name; sys_charset_system.value= (char*) system_charset_info->csname; character_set_filesystem_name= (char*) "binary"; + lc_messages= (char*) "en_US"; lc_time_names_name= (char*) "en_US"; /* Set default values for some option variables */ default_storage_engine_str= (char*) "MyISAM"; @@ -7856,7 +7875,7 @@ mysqld_get_one_option(int optid, sql_print_warning("Ignoring user change to '%s' because the user was set to '%s' earlier on the command line\n", argument, mysqld_user); break; case 'L': - strmake(language, argument, sizeof(language)-1); + strmake(lc_messages_dir, argument, sizeof(lc_messages_dir)-1); break; #ifdef HAVE_REPLICATION case OPT_SLAVE_SKIP_ERRORS: @@ -8602,7 +8621,7 @@ static int fix_paths(void) --mysql_unpacked_real_data_home_len; - convert_dirname(language,language,NullS); + convert_dirname(lc_messages_dir, lc_messages_dir, NullS); (void) my_load_path(mysql_home,mysql_home,""); // Resolve current dir (void) my_load_path(mysql_real_data_home,mysql_real_data_home,mysql_home); (void) my_load_path(pidfile_name,pidfile_name,mysql_real_data_home); @@ -8616,7 +8635,7 @@ static int fix_paths(void) else strxnmov(buff,sizeof(buff)-1,mysql_home,sharedir,NullS); convert_dirname(buff,buff,NullS); - (void) my_load_path(language,language,buff); + (void) my_load_path(lc_messages_dir, lc_messages_dir, buff); /* If --character-sets-dir isn't given, use shared library dir */ if (charsets_dir != mysql_charsets_dir) -- cgit v1.2.1 From 1ad9d1f1df99e81b5dc68c3f619e2a4d3b867366 Mon Sep 17 00:00:00 2001 From: Sergey Glukhov Date: Fri, 23 Oct 2009 11:20:44 +0500 Subject: Bug#5299 Remove SHOW COLUMN TYPES, backport to Betony --- sql/mysqld.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a4fb55a60d7..8176f71f726 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -3075,7 +3075,6 @@ SHOW_VAR com_status_vars[]= { {"show_binlogs", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_BINLOGS]), SHOW_LONG_STATUS}, {"show_charsets", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CHARSETS]), SHOW_LONG_STATUS}, {"show_collations", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLLATIONS]), SHOW_LONG_STATUS}, - {"show_column_types", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_COLUMN_TYPES]), SHOW_LONG_STATUS}, {"show_contributors", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CONTRIBUTORS]), SHOW_LONG_STATUS}, {"show_create_db", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_DB]), SHOW_LONG_STATUS}, {"show_create_event", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_CREATE_EVENT]), SHOW_LONG_STATUS}, -- cgit v1.2.1 From d7030396d21b3d7d082e46434bc7715e3366cb21 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Fri, 23 Oct 2009 11:45:03 +0400 Subject: Backport of patch for Bug#46267. Original revision: ------------------------------------------------------------ revno: 2801.10.16 committer: Vladislav Vaintroub branch nick: mysql-azalea-bugfixing timestamp: Mon 2009-08-10 13:26:23 +0200 message: Bug #46267 Shutdown with idle connection crash the server. The crash happens when mysqld logs a warning. The macro ER() used in sql_print_warning references thread local storage variable via current_thd(), to output the warning in "current user language". However, for the shutdown thread, current_thd() will return NULL, and mysqld will crash while derefencing NULL pointer. Solution: get error mesage text with ER_DEFAULT() macro instead of ER(), this does not current_thd() and will output errors in default language. ------------------------------------------------------------ --- sql/mysqld.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a4fb55a60d7..76c57247f15 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1001,7 +1001,7 @@ static void close_connections(void) if (tmp->vio_ok()) { if (global_system_variables.log_warnings) - sql_print_warning(ER(ER_FORCING_CLOSE),my_progname, + sql_print_warning(ER_DEFAULT(ER_FORCING_CLOSE),my_progname, tmp->thread_id, (tmp->main_security_ctx.user ? tmp->main_security_ctx.user : "")); -- cgit v1.2.1 From 54b5ef84ca0c5e3ab8e5cdc5f97da6b7cbcd4d15 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 29 Oct 2009 09:07:29 -0600 Subject: Bug#38967 Unused mutex LOCK_Acl Backport to 5.5 --- sql/mysqld.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 7ce2bc036b0..1b5fdf028cf 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -653,7 +653,7 @@ SHOW_COMP_OPTION have_community_features; pthread_key(MEM_ROOT**,THR_MALLOC); pthread_key(THD*, THR_THD); -pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count, +pthread_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_thread_count, LOCK_mapped_file, LOCK_status, LOCK_global_read_lock, LOCK_error_log, LOCK_uuid_generator, LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create, @@ -1422,7 +1422,6 @@ static void clean_up_mutexes() { (void) pthread_mutex_destroy(&LOCK_mysql_create_db); (void) pthread_mutex_destroy(&LOCK_lock_db); - (void) pthread_mutex_destroy(&LOCK_Acl); (void) rwlock_destroy(&LOCK_grant); (void) pthread_mutex_destroy(&LOCK_open); (void) pthread_mutex_destroy(&LOCK_thread_count); @@ -3570,7 +3569,6 @@ static int init_thread_environment() { (void) pthread_mutex_init(&LOCK_mysql_create_db,MY_MUTEX_INIT_SLOW); (void) pthread_mutex_init(&LOCK_lock_db,MY_MUTEX_INIT_SLOW); - (void) pthread_mutex_init(&LOCK_Acl,MY_MUTEX_INIT_SLOW); (void) pthread_mutex_init(&LOCK_open, MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW); -- cgit v1.2.1 From afc87e52ac154db1ae97dc917c3e80e2872b868b Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Thu, 29 Oct 2009 09:21:16 -0600 Subject: Bug#38968 Unused mutex LOCK_bytes_sent, LOCK_bytes_received Backport for 5.5 --- sql/mysqld.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sql/mysqld.cc') diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 1b5fdf028cf..309294c91fd 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -657,7 +657,7 @@ pthread_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_thread_count, LOCK_mapped_file, LOCK_status, LOCK_global_read_lock, LOCK_error_log, LOCK_uuid_generator, LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create, - LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received, + LOCK_crypt, LOCK_global_system_variables, LOCK_user_conn, LOCK_slave_list, LOCK_active_mi, LOCK_connection_count, LOCK_error_messages; @@ -1433,8 +1433,6 @@ static void clean_up_mutexes() (void) pthread_mutex_destroy(&LOCK_delayed_create); (void) pthread_mutex_destroy(&LOCK_manager); (void) pthread_mutex_destroy(&LOCK_crypt); - (void) pthread_mutex_destroy(&LOCK_bytes_sent); - (void) pthread_mutex_destroy(&LOCK_bytes_received); (void) pthread_mutex_destroy(&LOCK_user_conn); (void) pthread_mutex_destroy(&LOCK_connection_count); Events::destroy_mutexes(); @@ -3579,8 +3577,6 @@ static int init_thread_environment() (void) pthread_mutex_init(&LOCK_delayed_create,MY_MUTEX_INIT_SLOW); (void) pthread_mutex_init(&LOCK_manager,MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_crypt,MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_bytes_sent,MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_bytes_received,MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST); (void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST); -- cgit v1.2.1