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>
create()/populate()
- Remove spurious exception warping in ::Replicated::execute_reliably
(RT#113339)
+ - 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::Exception;
use DBIx::Class::Optional::Dependencies;
use DBIx::Class::_Util qw(sigwarn_silencer scope_guard);
+use Scalar::Util 'weaken';
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(sub { $_[1]->do("DROP TABLE artist") });
}}