Update DSNParser in all tools.

This commit is contained in:
Daniel Nichter
2012-05-24 11:25:20 -06:00
parent bb5d64b4a6
commit c670ac4ba4
23 changed files with 197 additions and 98 deletions

View File

@@ -28,6 +28,8 @@ use Data::Dumper;
$Data::Dumper::Indent = 0;
$Data::Dumper::Quotekeys = 0;
my $dsn_sep = qr/(?<!\\),/;
eval {
require DBI;
};
@@ -82,7 +84,8 @@ sub parse {
my %final_props;
my $opts = $self->{opts};
foreach my $dsn_part ( split(/,/, $dsn) ) {
foreach my $dsn_part ( split($dsn_sep, $dsn) ) {
$dsn_part =~ s/\\,/,/g;
if ( my ($prop_key, $prop_val) = $dsn_part =~ m/^(.)=(.*)$/ ) {
$given_props{$prop_key} = $prop_val;
}