X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI.pm;h=336ab1f346a4aae0064b908c31fbaf318c5c6717;hb=9a0891be053bee63872959e94da0d790934d48bf;hp=5f71f02dd89ff700589f5e88ff5a06f5f28e07a2;hpb=58ded37e2fa0f8d629209a6bb3a29df986d199ca;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index 5f71f02..336ab1f 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -479,6 +479,7 @@ sub connect_info { 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); @@ -489,6 +490,8 @@ sub connect_info { $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; @@ -1428,7 +1431,10 @@ Returns the datetime parser class sub datetime_parser { my $self = shift; - return $self->{datetime_parser} ||= $self->build_datetime_parser(@_); + return $self->{datetime_parser} ||= do { + $self->ensure_connected; + $self->build_datetime_parser(@_); + }; } =head2 datetime_parser_type