commit message for description of exact failure scenario)
- Fix corner case of stringify-only overloaded objects being used in
create()/populate()
+ - Remove spurious exception warping in ::Replicated::execute_reliably
+ (RT#113339)
- 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)
my $self = shift;
my $coderef = shift;
- unless( ref $coderef eq 'CODE') {
- $self->throw_exception('Second argument must be a coderef');
- }
+ $self->throw_exception('Second argument must be a coderef')
+ unless( ref $coderef eq 'CODE');
## replace the current read handler for the remainder of the scope
local $self->{read_handler} = $self->master;
- my $args = \@_;
- return dbic_internal_try {
- $coderef->(@$args);
- } catch {
- $self->throw_exception("coderef returned an error: $_");
- };
+ &$coderef;
}
=head2 set_reliable_storage
is $debug{storage_type}, 'MASTER',
"got last query from a master: $debug{dsn}";
+ $_[1] = 9;
+
} => 'created coderef properly';
-$replicated->schema->storage->execute_reliably($reliably);
+my @list_to_mangle = (1, 2, 3);
+
+$replicated->schema->storage->execute_reliably($reliably, @list_to_mangle);
+
+is_deeply
+ \@list_to_mangle,
+ [ 1, 9, 3],
+ 'Aliasing of values passed to execute_reliably works'
+;
## Try something with an error
qr/Can't find source for ArtistXX/
=> 'Bad coderef throws proper error';
+throws_ok {
+ $replicated->schema->storage->execute_reliably(sub{
+ die bless [], 'SomeExceptionThing';
+ });
+} 'SomeExceptionThing', "Blessed exception kept intact";
+
## Make sure replication came back
ok $replicated->schema->resultset('Artist')->find(3)