Sybase/Storage/ASE/IdentityRetrieval.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 100% 1 / 1 totaltotal 100% 30 / 30 CC 3 SCAR 5.6
CC
3
Cov
100%
_execute
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« Sybase/Storage/FreeTDS.pm ↑ Summary Shortcut/syb.pm »
1 package DBIO::Sybase::Storage::ASE::IdentityRetrieval;
2 # ABSTRACT: Identity retrieval for Sybase ASE
3  
4 34 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 34 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 34 our $VERSION = '0.900007';
8  
9 34 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 # No requires - these methods expect the consuming class to have:
12 # _identity, _perform_autoinc_retrieval, sql_maker, next::method
13  
14 85 ▶sub _fetch_identity_sql {
Subroutine _fetch_identity_sql: called CC=1 SCAR=0.0
15 85 my ($self, $source, $col) = @_;
16  
17 return sprintf ("SELECT MAX(%s) FROM %s",
18 85 map { $self->sql_maker->_quote ($_) } ($col, $source->from)
19 );
20 }
21  
22 # Called during execute to retrieve identity after insert
23 255 ▶sub _execute {
Subroutine _execute: called CC=3 SCAR=11.0
24 255 my $self = shift;
25 255 my ($rv, $sth, @bind) = $self->next::method(@_);
26  
27 249 ▶ $self->_identity( ($sth->fetchall_arrayref)->[0][0] )
Branch: 1 branch
BranchTrueFalseTotal
if $self->_perform_autoinc_retrieval 87 162 249
28 if $self->_perform_autoinc_retrieval;
29  
30 249 ▶ return wantarray ? ($rv, $sth, @bind) : $rv;
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 101 148 249
31 }
32  
33 174 ▶sub last_insert_id { shift->_identity }
Subroutine last_insert_id: called CC=1 SCAR=0.0
Pod documented
34  
35  
36 34 1;
37  
38 __END__
« Sybase/Storage/FreeTDS.pm ↑ Summary Shortcut/syb.pm »