From: Nirbhay Choubey Date: August 3 2012 5:42pm Subject: bzr push into mysql-5.6 branch (nirbhay.choubey:4112 to 4113) Bug#14392699 List-Archive: http://lists.mysql.com/commits/144513 X-Bug: 14392699 Message-Id: <20120803174228.30190.36794.4113@Nirbhay-lenovo> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4113 Nirbhay Choubey 2012-08-03 Bug#14392699: WHEN DEFAULTS-FILE USED, CLIENT CONNECTIONS HANG AFTER 'INSTALL PLUGIN' The server uses whatever is the current working directory at startup time to read the configuration files etc. Then it chdir's to the data directory for a number of valid reasons. So, when it's time to re-read the arguments at plugin load time the relative paths won't work as expected any more. This is correctly detected by the plugin loading code and an error is generated. Unfortunately when this error is propagated up the stack one lock is not unlocked. This causes normal server operation to be impossible. Fixed by correctly releasing the lock in case of an error. Also, made a minor change in the default option handling to make sure that defaults file's path doesn't get re-evaluated. Automated testing not really possible, since pb2 and mtr have non-constant test directories relative layouts. Also, its currently not feasible to start a mysqld instance with a defaults file (with a non-absolute file name) and then use it to execute queries that make server to re-read the specified config file. modified: mysys_ssl/my_default.cc sql/sql_plugin.cc 4112 Inaam Rana 2012-08-03 Revert inaam.rana@stripped as it has caused performance regression. modified: storage/innobase/srv/srv0start.cc === modified file 'mysys_ssl/my_default.cc' --- a/mysys_ssl/my_default.cc 2012-06-11 15:33:10 +0000 +++ b/mysys_ssl/my_default.cc 2012-08-03 17:38:02 +0000 @@ -260,8 +260,8 @@ int my_search_option_files(const char *c int error= 0; DBUG_ENTER("my_search_option_files"); - /* Skip if default files have already been read. */ - if (! defaults_already_read) + /* Skip for login file. */ + if (! is_login_file) { /* Check if we want to force the use a specific default file */ *args_used+= get_defaults_options(*argc - *args_used, *argv + *args_used, @@ -630,12 +630,6 @@ int my_load_defaults(const char *conf_fi uint args_sep= my_getopt_use_args_separator ? 1 : 0; DBUG_ENTER("load_defaults"); - /* - Set it to FALSE, as this function can be invoked - multiple times with different conf_file. - */ - defaults_already_read= FALSE; - init_alloc_root(&alloc,512,0); if ((dirs= init_default_directories(&alloc)) == NULL) goto err; === modified file 'sql/sql_plugin.cc' --- a/sql/sql_plugin.cc 2012-06-29 11:56:41 +0000 +++ b/sql/sql_plugin.cc 2012-08-03 17:38:02 +0000 @@ -1836,6 +1836,7 @@ bool mysql_install_plugin(THD *thd, cons if (my_load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv, NULL)) { + mysql_rwlock_unlock(&LOCK_system_variables_hash); report_error(REPORT_TO_USER, ER_PLUGIN_IS_NOT_LOADED, name->str); goto err; } No bundle (reason: useless for push emails).