Bug #50688 Some comments in --defaults-file config are evaluated instead of being ignored
Submitted: 28 Jan 2010 13:23 Modified: 28 Jan 2010 21:34
Reporter: Tim Neubrander Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Proxy: Install/Config Severity:S3 (Non-critical)
Version:0.8.0 OS:Windows
Assigned to: CPU Architecture:Any
Tags: configuration

[28 Jan 2010 13:23] Tim Neubrander
Description:
Comments in the config file are not parsed out correctly.  If a comment (#) is added at the end of a line, it will be parsed as part of the line instead of 

How to repeat:
1.  Create a conf file: mysql-proxy.conf

[mysql-proxy]
daemon = true
proxy-address = hostname.example.com:3306 #this is a comment
proxy-backend-addresses = backendhostname.example.com:6446
log-file = c:\\InstallPath\\log\\mysql-proxy.log

2.  Create a service that invokes:
c:\InstallPath\bin\mysqlproxy-svc.exe --defaults-file=c:\InstallPath\conf\mysqlproxy.conf

3.  Error Log reports:
2010-01-28 08:16:00: (critical) ..\src\network-address.c:173: IP-address has to be in the form [<ip>][:<port>], is 'hostname.example.com:3306 #this is a comment'. Failed to parse the port at ' #this is a comment'
2010-01-28 08:16:00: (critical) ..\src\chassis.c:947: Failure from chassis_mainloop. Shutting down.
[28 Jan 2010 17:10] Jan Kneschke
Comments at and of line were never supported. 

In this case this was actually a bug in the address parsing which wasn't reported before, meantioned int he changelog as "* fixed parsing of invalid IP-addresses".
[28 Jan 2010 17:15] Jan Kneschke
For more detail see

http://library.gnome.org/devel/glib/stable/glib-Key-value-file-parser.html
[28 Jan 2010 21:34] Tim Neubrander
Thanks Jan.  I'm glad the change from the previous version was intentional.  I will update my configs.