}
sub DESTROY {
- # None of the reasons this would die matter if we're in DESTROY anyways
if (my $sth = $_[0]->sth) {
- local $SIG{__WARN__} = sub {};
- try { $sth->finish } if $sth->FETCH('Active');
+ # cleanup only core DBI handles, for anything more esoteric we
+ # assume they know how to clean up ater themselves
+ if ($sth->isa('DBI::st')) {
+ local $SIG{__WARN__} = sub {};
+ # None of the reasons this would die matter if we're in DESTROY anyways
+ try { $sth->finish } if $sth->FETCH('Active');
+ }
}
}
return if $self->cursor_sth;
- $self->cursor_sth($self->storage->sth($self->cursor_sql));
+ $self->cursor_sth($self->storage->_sth($self->cursor_sql));
}
sub _cleanup_sth {
}
$self->fetch_sth->finish if $self->fetch_sth;
- $self->fetch_sth($self->storage->sth($self->fetch_sql));
+ $self->fetch_sth($self->storage->_sth($self->fetch_sql));
$self->fetch_sth->execute;
}
drop_test_schema($schema);create_test_schema($schema);
my ($called,$page_size)=(0,0);
-my $old_sth_new=\&DBIx::Class::Storage::DBI::Pg::Sth::new;
-*DBIx::Class::Storage::DBI::Pg::Sth::new=sub {
- ++$called;$page_size=$_[4];
- goto &$old_sth_new;
-};
+{
+ no warnings 'redefine';
+ my $old_sth_new=\&DBIx::Class::Storage::DBI::Pg::Sth::new;
+ *DBIx::Class::Storage::DBI::Pg::Sth::new=sub {
+ ++$called;$page_size=$_[4];
+ goto &$old_sth_new;
+ };
+}
END {
return unless $schema;