Bug #60703 " --verbose --help" seems don't read the options in service name based group
Submitted: 31 Mar 2011 7:26 Modified: 28 Jun 2011 22:48
Reporter: paul zhou Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S2 (Serious)
Version:MySQL Community 5.5.9 OS:Microsoft Windows (Windows Server 2003 Standard Edition)
Assigned to: CPU Architecture:Any
Tags: --verbose --help, mysqld
Triage: Needs Triage: D3 (Medium)

[31 Mar 2011 7:26] paul zhou
Description:
If a MySQL windows service specify the service name, "mysqld --verbose --help"  seems don't read the options specified within service name based group.

How to repeat:
1.I run the mysql server as windows service of which the path to executable is 
""C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe"  --defaults-group-suffix=_others mysql_case_15_1". It specifies the defaults-group-suffix named _others and the service name is mysql_case_15_1.
2.I also created my.ini which located in C:/ as global option file .In my.ini I created following groups [mysql_case_15_1],[mysqld_others],[mysqld-5.5],[mysqld].And the port is specified in group [mysql_case_15_1],  The port is assumed to be 8888. 
3.As expected , the TCP port is 8888 after starting the service .
4.However,when I use "mysqld.exe --defaults-group-suffix=_others mysql_case_15_1 --verbose --help" to get the port option value ,the result is 3306 .And at first print out , it says "The following groups are read: mysqld server mysqld-5.5 mysqld_others server_others mysqld-5.5_others" .Not includes mysql_case_15_1 group.
5.I don't know the result is as your expected or it is an actual bug .
[31 Mar 2011 7:39] Valeriy Kravchuk
Our manual, http://dev.mysql.com/doc/refman/5.5/en/option-files.html#option_general_defaults-group-suf..., clearly says:

"--defaults-group-suffix=str

If this option is given, the program reads not only its usual option groups, but also groups with the usual names and a suffix of str."

I wonder where do you see "service name" there and why do you think that [mysql_case_15_1] group should be read. Maybe I miss something...
[31 Mar 2011 8:02] paul zhou
Thank you for quickly reply.
1.From http://dev.mysql.com/doc/refman/5.5/en/windows-start-service.html
--------------------------------------------------------------------------
If the service-installation command specifies a service name other than MySQL following the --install option, the server uses that service name. It reads options from the [mysqld] group and the group that has the same name as the service in the standard option files. This enables you to use the [mysqld] group for options that should be used by all MySQL services, and an option group with the service name for use by the server installed with that service name.
--------------------------------------------------------------------------
I think [mysql_case_15_1] group should be read .Actually, after starting the service , the port is from this group .
2.And from the command line ""C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe" --defaults-group-suffix=_others mysql_case_15_1" ,I think the service name is mysql_case_15_1 .
[31 Mar 2011 8:07] paul zhou
btw,"defaults-group-suffix" isn't concerned in this issue .Actually, this options already take effect from the result of "--verbose --help".
[31 Mar 2011 8:23] paul zhou
Maybe I should describe my problem clearly.In other word, when I run the command ""mysqld.exe --defaults-group-suffix=_others mysql_case_15_1 --verbose --help",the  mysql_case_15_1 group isn't read even this group already defined.
[31 Mar 2011 10:02] Valeriy Kravchuk
I understand your problem. I just do NOT understand why you expect mysql_case_15_1 argument to mysqld.exe command to have any influence.

Can you give me URL to some manual page that describes how it should work?
[31 Mar 2011 11:43] paul zhou
I think this link describes how it should work: http://dev.mysql.com/doc/refman/5.5/en/windows-start-service.html.It describe the rules determine the service name and option files that the server uses.
Actually,the servie name group take effect while running MySQL. My doubt is that why it don't read the group  when separately executing '--verbose --help' .
If I understood the manual the manual correctly,I think executing '--verbose --help' will list all options the server would really use.
Here is a link maybe helpful for you :http://dev.mysql.com/doc/refman/5.5/en/server-parameters.html.You can read the following content at the end of this web page.
------------------------------------------------------------------------------
To check the effect of specifying path options, invoke mysqld with those options followed by the --verbose and --help options. For example, if you change location into the directory where mysqld is installed and then run the following command, it shows the effect of starting the server with a base directory of /usr/local:
shell> ./mysqld --basedir=/usr/local --verbose --help
You can specify other options such as --datadir as well, but --verbose and --help must be the last options.
Once you determine the path settings you want, start the server without --verbose and --help.
------------------------------------------------------------------------------
[31 Mar 2011 13:26] Valeriy Kravchuk
OK, but it seems to me that this manual page applies only to mysqld.exe called with --install option to create Windows service.

Anyway, I agree that 

mysqld --help --verbose service_name

on Windows should say that it uses [service_name] group content IF it really uses it. I does not, according to my testing. Please, send the results of

sc qc service_name

for your MySQL service. I'd like to check what configuration file is used and what is there. Then compare that to netstat -a results.
[31 Mar 2011 16:25] paul zhou
Hi,attached pls find the output result of sc ,netstat,"--verbose --help" respectively.And the option file my.ini is also uploaded for your reference.
btw,the "--verbose --help" --verbose and --help must be the last options in the command line according the manual, otherwise, it can't get the options .
[1 Apr 2011 22:18] Miguel Solorzano
Could you please describe how you installed the service?. Thanks in advance.
[2 Apr 2011 1:25] paul zhou
I use below script to create service:
sc create mysql_case_15_1  binpath= "\"C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqld.exe\"  --defaults-group-suffix=_others mysql_case_15_1" displayname= "mysql_case_15_1"
[4 Apr 2011 19:29] Miguel Solorzano
Thank you for the feedback. Could you please clarify where in the MySQL documentation you got the server can handle that service image path you did without to use the recommend way using either the installer or the server binary according Manual's instructions?. Thanks in advance.
[25 Apr 2011 2:45] paul zhou
Sorry reply to you so late .
Yes,I didn't use the recommend way to install MySQL service.use sc command instead .
Actually, I also use the server binary according Manual's instructions to install. for example:
mysqld --install mysql_case_15_1
After installed , the image path is "\%MYSQL%\bin\mysqld --mysql_case_15_1". Unfortunitely,if "--verbose --help" still don't read the group [mysql_case_15_1] in option file .
[25 Apr 2011 2:47] paul zhou
Sorry reply to you so late .
Yes,I didn't use the recommend way to install MySQL service.use sc command instead .
Actually, I also use the server binary according Manual's instructions to install. for
example:
mysqld --install mysql_case_15_1
After installed , the image path is "\%MYSQL%\bin\mysqld mysql_case_15_1".
Unfortunitely,"--verbose --help" still don't read the group [mysql_case_15_1] in
option file .
[25 Apr 2011 2:57] paul zhou
after running the service instance, the netstat command shows that it already read the options in group [mysql_case_15_1].
[7 Jun 2011 20:26] Miguel Solorzano
I don't understand what you meant with your last comment. It is the issue resolved?.
[8 Jun 2011 13:45] paul zhou
Not yet. My last comment means the server do read the options in group [mysql_case_15_1] while launching mysql server. But the output of '--verbose --help' doesn't read the  options in group [mysql_case_15_1] .
[28 Jun 2011 22:48] Miguel Solorzano
Thank you for the feedback.