$dbh->{HandleError} (GH#101)
- Fix parsing of DSNs containing driver arguments (GH#99)
- Fix spurious warning on MSSQL cursor invalidation retries (RT#102166)
+ - Remove spurious exception warping in ::Replicated::execute_reliably
+ (RT#113339)
- Work around unreliable $sth->finish() on INSERT ... RETURNING within
DBD::Firebird on some compiler/driver combinations (RT#110979)
- Fix leaktest failures with upcoming version of Sub::Quote
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 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)