Revision history for DBIx::Class
+ - non-destructive hashref handling for connect_info options
- count no longer returns negative values after slice
(report and test from JOHANL)
- rebless before building datetime_parser
my $last_info = $dbi_info->[-1];
if(ref $last_info eq 'HASH') {
+ $last_info = { %$last_info }; # so delete is non-destructive
for my $storage_opt (qw/on_connect_do disable_sth_caching unsafe/) {
if(my $value = delete $last_info->{$storage_opt}) {
$self->$storage_opt($value);
$self->_sql_maker_opts->{$sql_maker_opt} = $opt_val;
}
}
+ # re-insert modified hashref
+ $dbi_info->[-1] = $last_info;
# Get rid of any trailing empty hashref
pop(@$dbi_info) if !keys %$last_info;
}
}
-plan tests => 5;
+plan tests => 6;
my $schema = DBICTest->init_schema();
is(1, $schema->resultset('Artist')->search({name => "Exploding Sheep" })->count,
"And the STH was retired");
+my $info = { on_connect_do => [] };
+
+$storage->connect_info(['foo','bar','baz',$info]);
+
+ok(exists($info->{on_connect_do}), q{Didn't kill key passed to storage});
1;