| 1 | # $Id$ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use DBI; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | package DBIx::LogAny::st; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | @DBIx::LogAny::st::ISA = qw(DBI::st DBIx::LogAny); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use DBIx::LogAny::Constants qw (:masks $LogMask); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | sub finish { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 0 | ▶ | my ($sth) = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
finish: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | my $h = _unseen_sth($sth); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | $sth->_dbix_la_debug($h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | "finish($h->{dbh_no}.$sth->{private_DBIx_st_no})") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_INPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | return $sth->SUPER::finish; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | # NOTE: execute can be called from the DBD. Now we support retrieving | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | # dbms_output from DBD::Oracle we need a flag to say we are in the | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | # 'dbms_output_get' or when we call dbms_output_get we will log a second | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | # execute and potentially recurse until we run out of stack. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | # We use the "dbd_specific" flag since we may need it for other | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | # drivers in the future and that is the logging flag we implement dbms_output | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | # fetching under | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | sub execute { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | ▶ | my $sth = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
execute: not called CC=23 SCAR=63.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | my $h = $sth->{private_DBIx_LogAny}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | if (($h->{logmask} & (DBIX_LA_LOG_INPUT|DBIX_LA_LOG_SQL)) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$h->{"logmask"} & 513 and not +(caller) =~ /^DBD::/o and not $h->{"dbd_specific"}
$h->{"logmask"} & 513 and not +(caller) =~ /^DBD::/o
MC/DC0%0/3
$h->{"logmask"} & 513 and not +(caller) =~ /^DBD::/o and not $h->{"dbd_specific"}
$h->{"logmask"} & 513
not +(caller) =~ /^DBD::/o
not $h->{"dbd_specific"}
Truth table0%0/4
A and not(B) and not(C)
A= $h->{"logmask"} & 513B= not +(caller) =~ /^DBD::/oC= not $h->{"dbd_specific"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | (caller !~ /^DBD::/o) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | (!$h->{dbd_specific})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | my $params; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | #if (defined($sth->{ParamValues})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | # $params = '{params => '; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | # foreach (sort keys %{$sth->{ParamValues}}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | # $params .= "$_=" . DBI::neat($h->{ParamValues}->{$_}) . ","; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | # } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | # $params .= '}'; # TO_DO not used yet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | #} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | if (scalar(@_)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | $h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | "execute($h->{dbh_no}.$sth->{private_DBIx_st_no}) (" . | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | ▶ | ($sth->{Statement} ? $sth->{Statement} : '') . ')', @_); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | my @param_info; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | push @param_info, $sth->{ParamValues}, $sth->{ParamTypes} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_DELAYBINDPARAM); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | $sth->_dbix_la_debug( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | $h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | "execute($h->{dbh_no}.$sth->{private_DBIx_st_no})", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | @param_info); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | my $ret = $sth->SUPER::execute(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | # If DBDSPECIFIC is enabled and this is DBD::Oracle we will attempt to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | # to retrieve any dbms_output. However, 'dbms_output_get' actually | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | # creates a new statement, prepares it, executes it, binds parameters | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | # and then fetches the dbms_output. This will cause this execute method | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | # to be called again and we could recurse forever. To prevent that | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | # happening we set {dbd_specific} flag before calling dbms_output_get | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | # and clear it afterwards. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | # Also in DBI (at least up to 1.54) and most DBDs, the same memory is | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | # used for a dbh errstr/err/state and each statement under it. As a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | # result, if you sth1->execute (it fails) then $sth2->execute which | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | # succeeds, sth1->errstr/err are undeffed :-( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | # see http://www.nntp.perl.org/group/perl.dbi.users/2007/02/msg30971.html | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | # To sort this out, we save the errstr/err/state on the first sth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | # and put them back after using the second sth (ensuring we temporarily | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | # turn off any error handler to avoid set_err calling them again). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | if (($h->{logger}->is_debug()) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/9
$h->{"logger"}->is_debug and $h->{"logmask"} & 128 and $h->{"driver"} eq "Oracle" and not $h->{"dbd_specific"}
$h->{"logger"}->is_debug and $h->{"logmask"} & 128 and $h->{"driver"} eq "Oracle"
$h->{"logger"}->is_debug and $h->{"logmask"} & 128
MC/DC0%0/4
$h->{"logger"}->is_debug and $h->{"logmask"} & 128 and $h->{"driver"} eq "Oracle" and not $h->{"dbd_specific"}
$h->{"logger"}->is_debug
$h->{"logmask"} & 128
$h->{"driver"} eq "Oracle"
not $h->{"dbd_specific"}
Truth table0%0/5
A and B and C and not(D)
A= $h->{"logger"}->is_debugB= $h->{"logmask"} & 128C= $h->{"driver"} eq "Oracle"D= not $h->{"dbd_specific"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | ($h->{logmask} & DBIX_LA_LOG_DBDSPECIFIC) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | ($h->{driver} eq 'Oracle') && (!$h->{dbd_specific})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | my ($errstr, $err, $state) = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | $sth->errstr, $sth->err, $sth->state); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | $h->{dbd_specific} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 0 | my $dbh = $sth->FETCH('Database'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | my @lines = $dbh->func('dbms_output_get'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | $sth->_dbix_la_debug($h, 2, 'dbms', @lines) if (scalar(@lines) > 0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | $h->{dbd_specific} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | local $sth->{HandleError} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | local $sth->{HandleSetErr} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 0 | $sth->set_err($err, $errstr, $state); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | if (!$ret) { # error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | if (($h->{logmask} & DBIX_LA_LOG_ERRCAPTURE) && # logging errors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$h->{"logmask"} & 16 and not +(caller) =~ /^DBD::/o
MC/DC0%0/2
$h->{"logmask"} & 16 and not +(caller) =~ /^DBD::/o
$h->{"logmask"} & 16
not +(caller) =~ /^DBD::/o
Truth table0%0/3
A and not(B)
A= $h->{"logmask"} & 16B= not +(caller) =~ /^DBD::/o
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | (caller !~ /^DBD::/o)) { # ! called from DBD e.g. execute_array | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | if ((exists($h->{err_regexp}) && ($sth->err !~ $h->{err_regexp})) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
exists $h->{"err_regexp"} and not $sth->err =~ /$h->{"err_regexp"}/ or not exists $h->{"err_regexp"}
exists $h->{"err_regexp"} and not $sth->err =~ /$h->{"err_regexp"}/
MC/DC0%0/3
exists $h->{"err_regexp"} and not $sth->err =~ /$h->{"err_regexp"}/ or not exists $h->{"err_regexp"}
exists $h->{"err_regexp"}
not $sth->err =~ /$h->{"err_regexp"}/
not exists $h->{"err_regexp"}
Truth table0%0/5
A and not(B) or not(C)
A= exists $h->{"err_regexp"}B= not $sth->err =~ /$h->{"err_regexp"}/C= not exists $h->{"err_regexp"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | (!exists($h->{err_regexp}))) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | $sth->_dbix_la_error( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 2, "\tfailed with " . DBI::neat($sth->errstr)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | ▶ | } elsif (defined($ret) && (!$h->{dbd_specific})) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
defined $ret and not $h->{"dbd_specific"}
MC/DC0%0/2
defined $ret and not $h->{"dbd_specific"}
defined $ret
not $h->{"dbd_specific"}
Truth table0%0/3
A and not(B)
A= defined $retB= not $h->{"dbd_specific"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | $h, 2, "affected($h->{dbh_no}.$sth->{private_DBIx_st_no})", $ret) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | if ((!defined($sth->{NUM_OF_FIELDS})) && # not a result-set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | ▶ | ($h->{logmask} & DBIX_LA_LOG_INPUT) && # logging input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
not defined $sth->{"NUM_OF_FIELDS"} and $h->{"logmask"} & 1 and not +(caller) =~ /^DBD::/o
not defined $sth->{"NUM_OF_FIELDS"} and $h->{"logmask"} & 1
MC/DC0%0/3
not defined $sth->{"NUM_OF_FIELDS"} and $h->{"logmask"} & 1 and not +(caller) =~ /^DBD::/o
not defined $sth->{"NUM_OF_FIELDS"}
$h->{"logmask"} & 1
not +(caller) =~ /^DBD::/o
Truth table0%0/4
not(A) and B and not(C)
A= not defined $sth->{"NUM_OF_FIELDS"}B= $h->{"logmask"} & 1C= not +(caller) =~ /^DBD::/o
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | (caller !~ /^DBD::/o)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | return $ret; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | sub execute_array { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | my ($sth, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
execute_array: not called CC=20 SCAR=60.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 0 | my $h = $sth->{private_DBIx_LogAny}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | $sth->_dbix_la_debug($h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | "execute_array($h->{dbh_no}.$sth->{private_DBIx_st_no})", @args) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_INPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 0 | ▶ | if (($#args >= 0) && ($args[0]) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/9
$#args >= 0 and $args[0] and ref $args[0] eq "HASH" and not exists $args[0]{"ArrayTupleStatus"}
$#args >= 0 and $args[0] and ref $args[0] eq "HASH"
$#args >= 0 and $args[0]
MC/DC0%0/4
$#args >= 0 and $args[0] and ref $args[0] eq "HASH" and not exists $args[0]{"ArrayTupleStatus"}
$#args >= 0
$args[0]
ref $args[0] eq "HASH"
not exists $args[0]{"ArrayTupleStatus"}
Truth table0%0/5
A and B and C and not(D)
A= $#args >= 0B= $args[0]C= ref $args[0] eq "HASH"D= not exists $args[0]{"ArrayTupleStatus"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | (ref($args[0]) eq 'HASH') && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | (!exists($args[0]->{ArrayTupleStatus}))) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | $args[0]->{ArrayTupleStatus} = \my @tuple_status; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | } elsif (!$args[0]) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | $args[0] = {ArrayTupleStatus => \my @tuple_status}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 0 | my $array_tuple_status = $args[0]->{ArrayTupleStatus}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | # NOTE: We have a problem here. The DBI pod stipulates that | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | # execute_array returns undef (for error) or the number of tuples | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | # executed. If we want to access the number of rows updated or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | # inserted then we need to add up the values in the ArrayTupleStatus. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | # Unfortunately, the drivers which implement execute_array themselves | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | # (e.g. DBD::Oracle) don't do this properly (e.g. DBD::Oracle 1.18a). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | # As a result, until this is sorted out, our logging of execute_array | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | # may be less than accurate. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | # NOTE: DBD::Oracle 1.19 is working now from my supplied patch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 0 | my ($executed, $affected) = $sth->SUPER::execute_array(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | 0 | ▶ | if (!$executed) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | #print Data::Dumper->Dump([$sth->{ParamArrays}], ['ParamArrays']), "\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | ▶ | if (!$h->{logmask} & DBIX_LA_LOG_ERRORS) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | return $executed unless wantarray; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | return ($executed, $affected); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 0 | my $pa = $sth->{ParamArrays}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 0 | $sth->_dbix_la_error(2, "execute_array error:"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | for my $n (0..@{$array_tuple_status}-1) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | next if (!ref($array_tuple_status->[$n])); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | $sth->_dbix_la_error('Error', $array_tuple_status->[$n]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | my @plist; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 0 | foreach my $p (keys %{$pa}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | ▶ | if (ref($pa->{$p})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | push @plist, $pa->{$p}->[$n]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | push @plist, $pa->{$p}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | $sth->_dbix_la_error( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | 2, "\t for " . join(',', map(DBI::neat($_), @plist))); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | } elsif ($executed) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | ▶ | if ((defined($sth->{NUM_OF_FIELDS})) || # result-set | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $sth->{"NUM_OF_FIELDS"} or not $h->{"logmask"} & 1
MC/DC0%0/2
defined $sth->{"NUM_OF_FIELDS"} or not $h->{"logmask"} & 1
defined $sth->{"NUM_OF_FIELDS"}
not $h->{"logmask"} & 1
Truth table0%0/3
A or not(B)
A= defined $sth->{"NUM_OF_FIELDS"}B= not $h->{"logmask"} & 1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | !($h->{logmask} & DBIX_LA_LOG_INPUT)) { # logging input | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 0 | ▶ | return $executed unless wantarray; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | return ($executed, $affected); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | $sth->_dbix_la_debug($h, 2, "executed $executed, affected " . | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | DBI::neat($affected)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | $sth->_dbix_la_debug($h, 2, Data::Dumper->Dump( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | [$array_tuple_status], ['ArrayTupleStatus'])) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_INPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | return $executed unless wantarray; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | return ($executed, $affected); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | sub bind_param { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | ▶ | my $sth = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bind_param: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | my $h = $sth->{private_DBIx_LogAny}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | $h, 2, "bind_param($h->{dbh_no}.$sth->{private_DBIx_st_no})", @_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | if (($h->{logmask} & DBIX_LA_LOG_INPUT) && | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | (($h->{logmask} & DBIX_LA_LOG_DELAYBINDPARAM) == 0)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$h->{"logmask"} & 1 and ($h->{"logmask"} & 256) == 0
MC/DC0%0/2
$h->{"logmask"} & 1 and ($h->{"logmask"} & 256) == 0
$h->{"logmask"} & 1
($h->{"logmask"} & 256) == 0
Truth table0%0/3
A and B
A= $h->{"logmask"} & 1B= ($h->{"logmask"} & 256) == 0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | return $sth->SUPER::bind_param(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | sub bind_param_inout { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 0 | ▶ | my $sth = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bind_param_inout: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 0 | my $h = $sth->{private_DBIx_LogAny}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | $h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | "bind_param_inout($h->{dbh_no}.$sth->{private_DBIx_st_no})", @_) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | ▶ | if (($h->{logmask} & DBIX_LA_LOG_INPUT) && (caller !~ /^DBD::/o)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$h->{"logmask"} & 1 and not +(caller) =~ /^DBD::/o
MC/DC0%0/2
$h->{"logmask"} & 1 and not +(caller) =~ /^DBD::/o
$h->{"logmask"} & 1
not +(caller) =~ /^DBD::/o
Truth table0%0/3
A and not(B)
A= $h->{"logmask"} & 1B= not +(caller) =~ /^DBD::/o
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | return $sth->SUPER::bind_param_inout(@_); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | sub bind_param_array { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 0 | ▶ | my($sth, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bind_param_array: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 0 | my $h = $sth->{private_DBIx_LogAny}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | $sth->_dbix_la_debug($h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | "bind_param_array($h->{dbh_no}.$sth->{private_DBIx_st_no})", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | ▶ | @args) if ($h->{logmask} & DBIX_LA_LOG_INPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | return $sth->SUPER::bind_param_array(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | sub fetch { # alias for fetchrow_arrayref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 0 | ▶ | my($sth, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fetch: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | 0 | my $h = _unseen_sth($sth); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 0 | my $res = $sth->SUPER::fetch(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | $h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | Data::Dumper->Dump([$res], ["fetch($h->{dbh_no}.$sth->{private_DBIx_st_no})"])) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_OUTPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 0 | return $res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | sub fetchrow_arrayref { # alias for fetchrow_arrayref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 0 | ▶ | my($sth, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fetchrow_arrayref: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 0 | my $h =_unseen_sth($sth); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 0 | my $res = $sth->SUPER::fetchrow_arrayref(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | $h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | Data::Dumper->Dump([$res], ["fetchrow_arrayref($h->{dbh_no}.$sth->{private_DBIx_st_no})"])) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_OUTPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 0 | return $res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | sub fetchrow_array { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 0 | ▶ | my ($sth, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fetchrow_array: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | 0 | my $h = _unseen_sth($sth); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 0 | ▶ | if (wantarray) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | my @row = $sth->SUPER::fetchrow_array(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | $h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | Data::Dumper->Dump( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | [\@row], ["fetchrow_array($h->{dbh_no}.$sth->{private_DBIx_st_no})"])) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_OUTPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 0 | return @row; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 0 | my $row = $sth->SUPER::fetchrow_array(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | $h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | Data::Dumper->Dump( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | [$row], ["fetchrow_array($h->{dbh_no}.$sth->{private_DBIx_st_no})"])) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_OUTPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | return $row; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | sub fetchrow_hashref { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | 0 | ▶ | my($sth, @args) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fetchrow_hashref: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | 0 | my $h = _unseen_sth($sth); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | my $res = $sth->SUPER::fetchrow_hashref(@args); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | $sth->_dbix_la_debug( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | $h, 2, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | Data::Dumper->Dump( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | [$res], ["fetchrow_hashref($h->{dbh_no}.$sth->{private_DBIx_st_no})"])) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 0 | ▶ | if ($h->{logmask} & DBIX_LA_LOG_OUTPUT); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 0 | return $res; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | # _unseen_sth is called when we might come across a statement handle which was | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | # not created via the prepare method e.g., a statement handle DBD::Oracle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | # magicked into existence when a function or procedure returns a cursor. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | # We need to save the private log handle and set the statement number. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | sub _unseen_sth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | 0 | ▶ | my $sth = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_unseen_sth: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | 0 | ▶ | if (!exists($sth->{private_DBIx_LogAny})) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | 0 | my $p = $sth->FETCH('Database')->{private_DBIx_LogAny}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | $sth->{private_DBIx_LogAny} = $p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 0 | $sth->{private_DBIx_st_no} = $p->{new_stmt_no}(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 0 | return $p; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 0 | return $sth->{private_DBIx_LogAny}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||