Comment 4 for bug 1007938

Revision history for this message
Kaiwang CHEN (kaiwangchen) wrote : Re: MySQLConfig doesn't support end-of-line comments

Yes, I neglected the manual does not define ";" as a comment starter in the middle of a line. However, it really could start a comment at the beginning of line with whitespace trimmed, as cited:
    Comment lines start with “#” or “;”. A “#” comment can start in the middle of a line as well.

I verified it by

[kc@dns1 msb_5_1_46]$ grep datadir my.sandbox.cnf;./my _print_defaults mysqld | grep datadir
;datadir = /home/kc/sandboxes/msb_5_1_46/data
[kc@dns1 msb_5_1_46]$ grep datadir my.sandbox.cnf;./my _print_defaults mysqld | grep datadir
#datadir = /home/kc/sandboxes/msb_5_1_46/data

[kc@dns1 msb_5_1_46]$ grep datadir my.sandbox.cnf;./my _print_defaults mysqld | grep datadir
datadir = ;/home/kc/sandboxes/msb_5_1_46/data
--datadir=;/home/kc/sandboxes/msb_5_1_46/data
[kc@dns1 msb_5_1_46]$ grep datadir my.sandbox.cnf;./my _print_defaults mysqld | grep datadir
datadir = #/home/kc/sandboxes/msb_5_1_46/data
--datadir=

Additionally I found my original patch is not against the right place. Enclosed is fixed version and with more tests.