Opened 15 years ago
Closed 13 years ago
#1537 closed Bugs (fixed)
no value given in 'mysql_password ='
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | Component: | program_options | |
Version: | Boost 1.34.1 | Severity: | Problem |
Keywords: | Cc: | s.ochsenknecht@… |
Description
Hi,
no value given in 'mysql_password ='
When I put this line in a conf file, I get this error. I think it should just accept this as the empty string.
Attachments (1)
Change History (9)
by , 13 years ago
Attachment: | ticket1537.patch added |
---|
comment:1 by , 13 years ago
Cc: | added |
---|
I attached a patch which allows these empty values in config files. I simply removed the exception and enhanced one test case.
But, I can not survey the impact and possible side effects. And do we really want this behavior? At least the tests seam to work fine.
Please comment.
- Sascha
comment:2 by , 13 years ago
I applied the patch.
With one small modification. Empty values are ignored and nothing is stored. I think it makes sense since an empty string can not be converted to every possible value type, e.g. integer options.
Cheers
- Sascha
comment:3 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I don't think that's a good idea. There's a difference between an empty value and no value.
comment:5 by , 13 years ago
I'd agree. Ignoring bits of config file seems a potentially confusing behaviour.
comment:6 by , 13 years ago
Ok, another proposal would be to store an empty value for string type values (also for collection of strings) and throwing a validation error for e.g. integer types: "invalid option value "
This is probably better than storing a default constructed value, which could be undefined. Or in other words, what is an empty integer? undefined or invalid (I would prefer invalid -> exception)?
Please comment.
comment:8 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
possible patch