Bug #39868 my.cnf is being parsed wrong for report-host
Submitted: 6 Oct 2008 1:02 Modified: 9 Oct 2008 13:19
Reporter: Baron Schwartz (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.26, 5.1.28 OS:Any
Assigned to: CPU Architecture:Any
Tags: qc
Triage: Triaged: D2 (Serious)

[6 Oct 2008 1:02] Baron Schwartz
report-host appears to gobble whitespace after it in my.cnf.

How to repeat:
The following in my.cnf


#*** MyISAM Specific options

# Size of the Key Buffer, used to cache index blocks for MyISAM tables.
# Do not set it larger than 30% of your available memory, as some memory
# is also required by the OS to cache rows. Even if you're not using
# MyISAM tables, you should still set it to 8-64M as it will also be
# used for internal temporary disk tables.
key_buffer_size = 1024M

Results in the following in SHOW VARIABLES:

| report_host                     | --key_buffer_size=1024M                           |
[6 Oct 2008 3:37] Valeriy Kravchuk
Thank you for a problem report. Verified with 5.1.28 also.
[9 Oct 2008 11:03] Sergei Golubchik
According to the manual, the syntax is "--report-host=host_name".
That is, the value is not optional - and if you omit it, the next option will be treated as a value. Same as in

  mysqld --report-host --key_buffer_size=1024M

or even

  grep --file --before-context=5
[9 Oct 2008 12:35] Baron Schwartz
is it just me, or are there other options that require the value to be on the same line?  I really thought I'd seen behavior before where it would not gobble the next "value" 20 lines further on in the file, but would complain instead that the value is missing.
[9 Oct 2008 13:07] Sergei Golubchik
I don't think there're options like that. Because when my.cnf is read it's converted (literally, not "similarly to", exactly, is converted) to the command line - all options get "--" prepended, comments are removed, everything is put on the same line. Then the command line is parsed. For the mysql there's no difference whether an option is specified in the cnf file or on the command line. The server doesn't even know the origin of every option when it parses the generated command line.
[9 Oct 2008 13:19] Baron Schwartz
I see, thanks!