# however beware - on older perls the exception seems randomly untrappable
# due to some weird race condition during thread joining :(((
local $SIG{__DIE__} if $SIG{__DIE__};
- local $@;
+ local $@ if DBIx::Class::_ENV_::UNSTABLE_DOLLARAT;
eval {
weaken $_[0]->{schema};
my $guard = scope_guard {
return if $guard_disarmed;
- local $SIG{__WARN__};
+ local $SIG{__WARN__} if $SIG{__WARN__};
Carp::cluck("
!!! DBIx::Class INTERNAL PANIC !!!
# due to some weird race condition during thread joining :(((
if (length ref $srcs->{$source_name} and refcount($srcs->{$source_name}) > 1) {
local $SIG{__DIE__} if $SIG{__DIE__};
- local $@;
+ local $@ if DBIx::Class::_ENV_::UNSTABLE_DOLLARAT;
eval {
$srcs->{$source_name}->schema($self);
weaken $srcs->{$source_name};
)
or
! do {
- local $self->storage->{_in_do_block_retry_handler} = 1;
+ local $self->storage->{_in_do_block_retry_handler} = 1
+ unless $self->storage->{_in_do_block_retry_handler};
$self->retry_handler->($self)
}
);
if ((not $self->_driver_determined) && (not $self->{_in_determine_driver})) {
my $started_connected = 0;
- local $self->{_in_determine_driver} = 1;
+
+ local $self->{_in_determine_driver} = 1
+ unless $self->{_in_determine_driver};
if (ref($self) eq __PACKAGE__) {
my $driver;
$table_name = $self->sql_maker->quote_char ? $table_name : uc($table_name);
local $dbh->{LongReadLen} = 100000;
+
+ # FIXME - this is likely *WRONG*
local $dbh->{LongTruncOk} = 1;
my $sth = $dbh->prepare(<<'EOF');
return shift->$next(@_)
if $self->transaction_depth;
- # cheat the blockrunner we are just about to create
- # we do want to rerun things regardless of outer state
- local $self->{_in_do_block};
+ # Cheat the blockrunner we are just about to create:
+ # We *do* want to rerun things regardless of outer state
+ local $self->{_in_do_block}
+ if $self->{_in_do_block};
- return DBIx::Class::Storage::BlockRunner->new(
+ DBIx::Class::Storage::BlockRunner->new(
storage => $self,
wrap_txn => 0,
retry_handler => sub {
my $inner_subq = do {
# must use it here regardless of user requests (vastly gentler on optimizer)
- local $self->{_use_join_optimizer} = 1;
+ local $self->{_use_join_optimizer} = 1
+ unless $self->{_use_join_optimizer};
# throw away multijoins since we def. do not care about those inside the subquery
# $inner_aliastypes *will* be redefined at this point
# prove) but I do not know it offhand, especially on older environments
# Go with the safer option
if ($INC{'Test/Builder.pm'}) {
- local $| = 1;
- print "#\n";
+ select( ( select(\*STDOUT), $|=1 )[0] );
+ print STDOUT "#\n";
}
}
# we need to work with a forced fresh clone so that we do not upset any state
# of the main $schema (some tests examine it quite closely)
local $SIG{__WARN__} = sub {};
- local $SIG{__DIE__};
+ local $SIG{__DIE__} if $SIG{__DIE__};
local $@;
# this will either give us an undef $locktype or will determine things
# prove -lj10 xt/extra/internals/
#
select( ( select(\*STDOUT), $|=1 )[0] );
-
- print "#\n";
+ print STDOUT "#\n";
}
}
croak "Setting umask failed: $!" unless defined $old_umask;
scope_guard(sub {
- local ($@, $!, $?);
+ local ( $!, $^E, $?, $@ );
eval {
defined(umask $old_umask) or die "nope";