Revision history for DBIx::Class
* Fixes
- - Silence with_deferred_fk_checks() warning on PostgreSQL 9.4
- Fix updating multiple CLOB/BLOB columns on Oracle
0.082801 2014-10-05 23:55 (UTC)
$self->_do_query('SET CONSTRAINTS ALL DEFERRED');
- return preserve_context {
- my $inner_self = $self; # avoid nested closure leak on 5.8
- my $sg = Scope::Guard->new(sub {
- $inner_self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
- });
- $sub->()
- } after => sub { $txn_scope_guard->commit };
+ my $sg = Scope::Guard->new(sub {
+ $self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
+ });
+
+ return preserve_context { $sub->() } after => sub { $txn_scope_guard->commit };
}
=head2 connect_call_datetime_setup
$self->_do_query('SET CONSTRAINTS ALL DEFERRED');
- return preserve_context {
- my $inner_self = $self; # avoid nested closure leak on 5.8
- my $sg = Scope::Guard->new(sub {
- $inner_self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
- });
- $sub->()
- } after => sub { $txn_scope_guard->commit };
+ my $sg = Scope::Guard->new(sub {
+ $self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
+ });
+
+ return preserve_context { $sub->() } after => sub { $txn_scope_guard->commit };
}
# only used when INSERT ... RETURNING is disabled
use warnings;
use Test::More;
-use Test::Warn;
use Test::Exception;
use Sub::Name;
use Config;
$schema->source('CD')->name('dbic_t_schema.cd');
$schema->source('Track')->name('dbic_t_schema.track');
- lives_and { warning_is {
+ lives_ok {
$schema->storage->with_deferred_fk_checks(sub {
$schema->resultset('Track')->create({
trackid => 999, cd => 999, position => 1, title => 'deferred FK track'
artist => 1, cdid => 999, year => '2003', title => 'deferred FK cd'
});
});
- } undef } 'with_deferred_fk_checks code survived';
+ } 'with_deferred_fk_checks code survived';
is eval { $schema->resultset('Track')->find(999)->title }, 'deferred FK track',
'code in with_deferred_fk_checks worked';