| 1 | package DBIO::MSSQL::Storage::StopAtFirstError; | ||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: A statement handle whose execute_for_fetch stops at the first failing tuple | ||||||||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||||||||
| 4 | 25 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 5 | 25 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||
| 7 | 25 | our $VERSION = '0.900007'; | |||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||
| 9 | 25 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||
| 11 | 25 | our $AUTOLOAD; | |||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||
| 14 | 9 | ▶ | sub new { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 15 | 9 | my ($class, $sth) = @_; | |||||||||||||||||||||||||||||||||
| 16 | 9 | return bless { sth => $sth }, $class; | |||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||
| 20 | 9 | ▶ | sub execute_for_fetch { | ||||||||||||||||||||||||||||||||
|
Subroutine
execute_for_fetch: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 21 | 9 | my ($self, $fetch_tuple, $tuple_status, @rest) = @_; | |||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||
| 23 | 9 | ▶ | $tuple_status = [] unless $tuple_status; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||
| 25 | return $self->{sth}->execute_for_fetch( | ||||||||||||||||||||||||||||||||||
| 26 | 26 | ▶ | sub { | ||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||
| 27 | 26 | ▶ | return undef if @$tuple_status and ref $tuple_status->[-1]; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
@$tuple_status and ref $tuple_status->[-1]
MC/DC100%2/2
@$tuple_status and ref $tuple_status->[-1]
@$tuple_status
ref $tuple_status->[-1]
Truth table100%3/3
A and B
A= @$tuple_statusB= ref $tuple_status->[-1]
| |||||||||||||||||||||||||||||||||||
| 28 | 24 | return $fetch_tuple->(); | |||||||||||||||||||||||||||||||||
| 29 | }, | ||||||||||||||||||||||||||||||||||
| 30 | 9 | $tuple_status, | |||||||||||||||||||||||||||||||||
| 31 | @rest, | ||||||||||||||||||||||||||||||||||
| 32 | ); | ||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||
| 35 | 3 | ▶ | sub can { | ||||||||||||||||||||||||||||||||
|
Subroutine
can: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 36 | 3 | my ($self, $method) = @_; | |||||||||||||||||||||||||||||||||
| 37 | 3 | ▶ | return $self->SUPER::can($method) || ( ref $self && $self->{sth}->can($method) ); | ||||||||||||||||||||||||||||||||
|
Condition83%5/6
$self->SUPER::can($method) || ref $self && $self->{'sth'}->can($method)
ref $self and $self->{"sth"}->can($method)
MC/DC66%2/3
$self->SUPER::can($method) || ref $self && $self->{'sth'}->can($method)
$self->SUPER::can($method)
ref $self
$self->{"sth"}->can($method)
Truth table75%3/4
A || B and C
A= $self->SUPER::can($method)B= ref $selfC= $self->{"sth"}->can($method)
| |||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | sub DESTROY { } | ||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||
| 42 | 17 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 43 | 17 | my $self = shift; | |||||||||||||||||||||||||||||||||
| 44 | 17 | ( my $method = $AUTOLOAD ) =~ s/.*:://; | |||||||||||||||||||||||||||||||||
| 45 | 17 | return $self->{sth}->$method(@_); | |||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||
| 48 | 25 | 1; | |||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||
| 50 | __END__ | ||||||||||||||||||||||||||||||||||