- Optimized RowNum based Oracle limit-dialect (RT#61277)
* Fixes
+ - Fix memory leak during populate() on 5.8.x perls
- Make sure exception_action does not allow exception-hiding
due to badly-written handlers (the mechanism was never meant
to be able to suppress exceptions)
}
catch {
$err = shift;
+ };
+
+ # Statement must finish even if there was an exception.
+ try {
+ $sth->finish
}
- finally {
- # Statement must finish even if there was an exception.
- try {
- $sth->finish
- }
- catch {
- $err = shift unless defined $err
- };
+ catch {
+ $err = shift unless defined $err
};
$err = $sth->errstr
my $storage = $weak->{storage} = $s->storage;
memory_cycle_ok($storage, 'No cycles in storage');
- my $dbh = $weak->{dbh} = $s->storage->_get_dbh;
- memory_cycle_ok($dbh, 'No cycles in DBI handle');
-
- my $sqla = $weak->{sqla} = $s->storage->sql_maker;
- memory_cycle_ok($sqla, 'No cycles in SQL maker');
-
my $rs = $weak->{resultset} = $s->resultset ('Artist');
memory_cycle_ok($rs, 'No cycles in resultset');
my $row = $weak->{row} = $rs->first;
memory_cycle_ok($row, 'No cycles in row');
+ my $sqla = $weak->{sqla} = $s->storage->sql_maker;
+ memory_cycle_ok($sqla, 'No cycles in SQL maker');
+
+ my $dbh = $weak->{dbh} = $s->storage->_get_dbh;
+ memory_cycle_ok($dbh, 'No cycles in DBI handle');
+
+ for (@{$dbh->{ChildHandles}}) {
+ $weak->{"$_"} = $_ if $_;
+ }
+
weaken $_ for values %$weak;
memory_cycle_ok($weak, 'No cycles in weak object collection');
}
--- /dev/null
+use warnings;
+use strict;
+
+use Test::More;
+use lib 't/lib';
+use DBICTest;
+
+# Once upon a time there was a problem with a leaking $sth
+# which in turn delayed the $dbh destruction, which in turn
+# made the inode comaprison fire at the wrong time
+# This simulates the problem without doing much else
+for (1..2) {
+ my $schema = DBICTest->init_schema( sqlite_use_file => 1 );
+ $schema->storage->ensure_connected;
+ isa_ok ($schema, 'DBICTest::Schema');
+}
+
+done_testing;
+