Bug #83405 can't display compiled-in defaults of log_error_verbosity by mysqld --help --ver
Submitted: 17 Oct 2016 7:56 Modified: 11 Feb 2017 14:49
Reporter: Tsubasa Tanaka (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7.15, 8.0.0, 5.7.16 OS:CentOS (7.2)
Assigned to: CPU Architecture:Any

[17 Oct 2016 7:56] Tsubasa Tanaka
Description:
5.7 and 8.0 docs describe "To see the values that a server will use based on its compiled-in defaults, ignoring the settings in any option files, use this command:

mysqld --no-defaults --verbose --help"

http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html
http://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html

But the truth, log_error_verbosity is overridden to 1 when mysqld is given "--help" option.

See also Bug#79003

How to repeat:
See

https://github.com/mysql/mysql-server/blob/mysql-5.7.15/sql/mysqld.cc#L7608-L7621
https://github.com/mysql/mysql-server/blob/mysql-8.0.0/sql/mysqld.cc#L8255-L8268
[17 Oct 2016 7:58] Tsubasa Tanaka
How to repeat:

- mysqld --no-defaults --verbose --help displays log_error_verbosity= 1.

$ bin/mysqld --version
bin/mysqld  Ver 8.0.0-dmr for Linux on x86_64 (Source distribution)

$ bin/mysqld --no-defaults --verbose --help  | grep verbosity
2016-10-17T07:56:32.017840Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2016-10-17T07:56:32.017927Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
  --log-error-verbosity=#
log-error-verbosity                                          1

- But log_error_verbosity= 3 is coded in sql/sys_vars.cc

2035 static Sys_var_ulong Sys_log_error_verbosity(
2036        "log_error_verbosity",
2037        "How detailed the error log should be. "
2038        "1, log errors only. "
2039        "2, log errors and warnings. "
2040        "3, log errors, warnings, and notes. "
2041        "Messages sent to the client are unaffected by this setting.",
2042        GLOBAL_VAR(log_error_verbosity),
2043        CMD_LINE(REQUIRED_ARG),
2044        VALID_RANGE(1, 3), DEFAULT(3), BLOCK_SIZE(1), NO_MUTEX_GUARD,
2045        NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(update_log_error_verbosity));
[17 Oct 2016 8:57] MySQL Verification Team
Hello Tanaka-San,

Thank you for the report.

Thanks,
Umesh
[17 Oct 2016 8:59] Tsubasa Tanaka
Hello Umesh,

Thank you for your confirmation.

And I'm sorry to my mistake, I should refer Bug#79033 (Not 79003)..
[11 Feb 2017 14:49] Paul DuBois
Posted by developer:
 
The intent of --no-defaults is indeed to display the defaults unaffected by option files. If the server occasionally does other processing in addition before displaying help output, those execeptions are not going to be detailed here.