Opened 15 years ago

Closed 13 years ago

#1537 closed Bugs (fixed)

no value given in 'mysql_password ='

Reported by: Olaf van der Spek <OlafvdSpek@…> 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)

ticket1537.patch (2.4 KB ) - added by s.ochsenknecht@… 13 years ago.
possible patch

Download all attachments as: .zip

Change History (9)

by s.ochsenknecht@…, 13 years ago

Attachment: ticket1537.patch added

possible patch

comment:1 by s.ochsenknecht@…, 13 years ago

Cc: s.ochsenknecht@… 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 Sascha Ochsenknecht, 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 Sascha Ochsenknecht, 13 years ago

Resolution: fixed
Status: newclosed

(In [57819]) allow empty values in config file, Fixes #1537

comment:4 by olafvdspek@…, 13 years ago

Resolution: fixed
Status: closedreopened

I don't think that's a good idea. There's a difference between an empty value and no value.

comment:5 by Vladimir Prus, 13 years ago

I'd agree. Ignoring bits of config file seems a potentially confusing behaviour.

comment:6 by Sascha Ochsenknecht, 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:7 by olafvdspek@…, 13 years ago

Invalid

comment:8 by Sascha Ochsenknecht, 13 years ago

Resolution: fixed
Status: reopenedclosed

(In [57829]) store empty values from config file, Fixes #1537

Note: See TracTickets for help on using tickets.