* Fix typos in lib/ directory
* Update generated bin/ files
* PR 655 - War on typos Act 1 #655
- Updated modules in tools that were not updated
- Fixed tests to reflect proposed changes
---------
Co-authored-by: Sveta Smirnova <sveta.smirnova@percona.com>
Now it takes two arguments: A regexp and a string to match against.
_parse_varvals itself was split in three: _preprocess_varvals,
_parse_varvals, and _process_val.
This also modifies the three places that call _parse_varvals; For
two, no real changes were needed, but parse_mysqld() required a fix
to deal with the two final lines of mysqld --help --verbose:
To see what values a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'.
This turned out to be two bugs mangled into one.
First, _parse_varvals can deal with (var, undef), but not with (undef).
This is a problem because two of the trhee spots that call
_parse_varvals can return undef because of this:
map { $_ =~ m/^([^=]+)(?:=(.*))?$/ }
grep { $_ !~ m/^\s*#/ } # no # comment lines
split("\n", $mysqld_section)
The problem is twofold. First, we are not skipping empty or
whitespace-only lines. That means that the map will fail,
and pass an undef to _parse_varvals. So this ended up in
a triple fix: Make _parse_varvals deal with a sole undef,
skip empty/whitespace lines, and change that map to
map { $_ =~ m/^([^=]+)(?:=(.*))?$/ ? ($1, $2) : () }
so even if the regex fails in the future, no sole undef
will be passed down the chain.