Modify

Ticket #1537 (closed Bugs: fixed)

Opened 6 years ago

Last modified 4 years ago

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

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

Change History

Changed 4 years ago by s.ochsenknecht@…

possible patch

comment:1 Changed 4 years ago by s.ochsenknecht@…

  • 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 Changed 4 years ago by s_ochsenknecht

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 Changed 4 years ago by s_ochsenknecht

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:4 Changed 4 years ago by olafvdspek@…

  • Status changed from closed to reopened
  • Resolution fixed deleted

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

comment:5 Changed 4 years ago by vladimir_prus

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

comment:6 Changed 4 years ago by s_ochsenknecht

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 Changed 4 years ago by olafvdspek@…

Invalid

comment:8 Changed 4 years ago by s_ochsenknecht

  • Status changed from reopened to closed
  • Resolution set to fixed

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

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.