peter: Peter Collingbourne <peter@pcc.me.uk>
phaylon: Robert Sedlacek <phaylon@dunkelheit.at>
plu: Johannes Plunien <plu@cpan.org>
+pmooney: Paul Mooney <paul.mooney@net-a-porter.com>
Possum: Daniel LeWarne <possum@cpan.org>
pplu: Jose Luis Martinez <jlmartinez@capside.com>
quicksilver: Jules Bean <jules@jellybean.co.uk>
- Fix silencing of exceptions thrown by custom inflate_result() methods
- Fix complex prefetch when ordering over foreign boolean columns
( Pg can't MAX(boolcol) despite being able to ORDER BY boolcol )
+ - Fix infinite loop on ->svp_release("nonexistent_savepoint") (GH#97)
- Fix spurious ROLLBACK statements when a TxnScopeGuard fails a commit
of a transaction with deferred FK checks: a guard is now inactivated
immediately before the commit is attempted (RT#107159)
if (defined $name) {
my @stack = @{ $self->savepoints };
- my $svp;
+ my $svp = '';
- do { $svp = pop @stack } until $svp eq $name;
+ while( $svp ne $name ) {
- $self->throw_exception ("Savepoint '$name' does not exist")
- unless $svp;
+ $self->throw_exception ("Savepoint '$name' does not exist")
+ unless @stack;
+
+ $svp = pop @stack;
+ }
$self->savepoints(\@stack); # put back what's left
}
use Test::More;
use Test::Exception;
+use DBIx::Class::Optional::Dependencies;
+use DBIx::Class::_Util qw(sigwarn_silencer scope_guard);
+use Scalar::Util 'weaken';
use lib qw(t/lib);
use DBICTest;
# make sure a fresh txn will work after above
$schema->storage->txn_do(sub { ok "noop" } );
+### Make sure non-existend savepoint release doesn't infloop itself
+ {
+ weaken( my $s = $schema );
+
+ throws_ok {
+ $s->storage->txn_do(sub { $s->svp_release('wibble') })
+ } qr/Savepoint 'wibble' does not exist/,
+ "Calling svp_release on a non-existant savepoint throws expected error"
+ ;
+ }
+
### cleanupz
$schema->storage->dbh->do ("DROP TABLE artist");
}}