* Fixes
- Fix $rs->create() with no values on Oracle
+ - Silence with_deferred_fk_checks() warning on PostgreSQL 9.4
* Misc
- Speed up skipping CDBICompat tests when dependencies are missing
$self->_do_query('SET CONSTRAINTS ALL DEFERRED');
- my $sg = Scope::Guard->new(sub {
- $self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
- });
-
- return preserve_context { $sub->() } after => sub { $txn_scope_guard->commit };
+ return preserve_context {
+ my $sg = Scope::Guard->new(sub {
+ $self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
+ });
+ $sub->()
+ } after => sub { $txn_scope_guard->commit };
}
=head2 connect_call_datetime_setup
$self->_do_query('SET CONSTRAINTS ALL DEFERRED');
- my $sg = Scope::Guard->new(sub {
- $self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
- });
-
- return preserve_context { $sub->() } after => sub { $txn_scope_guard->commit };
+ return preserve_context {
+ my $sg = Scope::Guard->new(sub {
+ $self->_do_query('SET CONSTRAINTS ALL IMMEDIATE');
+ });
+ $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_ok {
+ lives_and { warning_is {
$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'
});
});
- } 'with_deferred_fk_checks code survived';
+ } undef } 'with_deferred_fk_checks code survived';
is eval { $schema->resultset('Track')->find(999)->title }, 'deferred FK track',
'code in with_deferred_fk_checks worked';