List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:June 20 2010 10:05pm
Subject:Re: bzr commit into mysql-next-mr-bugfixing branch (holyfoot:3249)
Bug#30025
View as plain text  
Hi, Alexey!

On Jun 19, Alexey Botchkov wrote:
> #At file:///home/hf/work/30025/ based on
> revid:alik@stripped
> 
>  3249 Alexey Botchkov	2010-06-19
>       Bug#30025 Mysqld prints out warnings/errors being run with --no-defaults --help
> 
>               getting the complete help requires some initialization like plugin
>               installing now. That process can possibly lead to errors. I just
> suppressed
>               all the error messages when --help was specified.

> === modified file 'sql/mysqld.cc'
> --- a/sql/mysqld.cc	2010-06-17 06:13:46 +0000
> +++ b/sql/mysqld.cc	2010-06-19 17:10:11 +0000
> @@ -4727,7 +4735,7 @@ int mysqld_main(int argc, char **argv)
>      We have enough space for fiddling with the argv, continue
>    */
>    check_data_home(mysql_real_data_home);
> -  if (my_setwd(mysql_real_data_home,MYF(MY_WME)) && !opt_help)
> +  if (!opt_help && my_setwd(mysql_real_data_home,MYF(MY_WME)))

This is not a good idea. You need to chdir to datadir before
initialiizing plugins, otherwise they may fail to initialize and --help
output will not show plugin command line options.

>      unireg_abort(1);				/* purecov: inspected */
>  
>    if ((user_info= check_user(mysqld_user)))
> @@ -7548,7 +7556,12 @@ static int get_options(int *argc_ptr, ch
>                                  mysqld_get_one_option)))
>      return ho_error;
>  
> -  if (!opt_help)
> +  if (opt_help)
> +  {
> +    logger.init_error_log(LOG_NONE);
> +    error_handler_hook= my_message_none;
> +  }

This is not exactly a good idea either. I've just recently fixed few
failures in the test suite - found only because of errors emitted during
mysqld --help --verbose.

If there are no errors there is no way to find out what's wrong and why,
for example, certain (or all) plugins are not detected by mtr (as mtr
detects engines by looking at mysqld --help --verbose).

Regards,
Sergei
Thread
bzr commit into mysql-next-mr-bugfixing branch (holyfoot:3249)Bug#30025Alexey Botchkov20 Jun
  • Re: bzr commit into mysql-next-mr-bugfixing branch (holyfoot:3249)Bug#30025Sergei Golubchik21 Jun