| 1 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | package # hide from PAUSE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | DBI; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # vim: ts=8:sw=4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # Copyright (c) 2002,2003 Tim Bunce Ireland. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # See COPYRIGHT section in DBI.pm for usage and distribution rights. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | # Please send patches and bug reports to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | # Jeff Zucker <jeff@vpservices.com> with cc to <dbi-dev@perl.org> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | ######################################################################## | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 107 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 107 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 107 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 107 | require Symbol; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 107 | ▶ | $DBI::PurePerl = $ENV{DBI_PUREPERL} || 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$ENV{'DBI_PUREPERL'} || 1
MC/DC0%0/1
$ENV{'DBI_PUREPERL'} || 1
$ENV{'DBI_PUREPERL'}
Truth table50%1/2
A
A= $ENV{'DBI_PUREPERL'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 107 | $DBI::PurePerl::VERSION = "2.014286"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 107 | ▶ | $DBI::neat_maxlen ||= 400; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$DBI::neat_maxlen ||= 400
MC/DC0%0/1
$DBI::neat_maxlen ||= 400
$DBI::neat_maxlen
Truth table50%1/2
A
A= $DBI::neat_maxlen
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 107 | $DBI::tfh = Symbol::gensym(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 107 | ▶ | open $DBI::tfh, ">&STDERR" or warn "Can't dup STDERR: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 107 | select( (select($DBI::tfh), $| = 1)[0] ); # autoflush | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | # check for weaken support, used by ChildHandles | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 107 | my $HAS_WEAKEN = eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 107 | require Scalar::Util; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | # this will croak() if this Scalar::Util doesn't have a working weaken(). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 107 | Scalar::Util::weaken( my $test = [] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 107 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 107 | %DBI::last_method_except = map { $_=>1 } qw(DESTROY _set_fbav set_err); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 107 | ▶ | use constant SQL_ALL_TYPES => 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 107 | ▶ | use constant SQL_ARRAY => 50; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 107 | ▶ | use constant SQL_ARRAY_LOCATOR => 51; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 107 | ▶ | use constant SQL_BIGINT => (-5); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 107 | ▶ | use constant SQL_BINARY => (-2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 107 | ▶ | use constant SQL_BIT => (-7); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 107 | ▶ | use constant SQL_BLOB => 30; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 107 | ▶ | use constant SQL_BLOB_LOCATOR => 31; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 107 | ▶ | use constant SQL_BOOLEAN => 16; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | 107 | ▶ | use constant SQL_CHAR => 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 107 | ▶ | use constant SQL_CLOB => 40; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 107 | ▶ | use constant SQL_CLOB_LOCATOR => 41; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | 107 | ▶ | use constant SQL_DATE => 9; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 107 | ▶ | use constant SQL_DATETIME => 9; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 107 | ▶ | use constant SQL_DECIMAL => 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 107 | ▶ | use constant SQL_DOUBLE => 8; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 107 | ▶ | use constant SQL_FLOAT => 6; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 107 | ▶ | use constant SQL_GUID => (-11); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 107 | ▶ | use constant SQL_INTEGER => 4; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 107 | ▶ | use constant SQL_INTERVAL => 10; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 107 | ▶ | use constant SQL_INTERVAL_DAY => 103; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 107 | ▶ | use constant SQL_INTERVAL_DAY_TO_HOUR => 108; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 107 | ▶ | use constant SQL_INTERVAL_DAY_TO_MINUTE => 109; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 107 | ▶ | use constant SQL_INTERVAL_DAY_TO_SECOND => 110; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 107 | ▶ | use constant SQL_INTERVAL_HOUR => 104; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 107 | ▶ | use constant SQL_INTERVAL_HOUR_TO_MINUTE => 111; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 107 | ▶ | use constant SQL_INTERVAL_HOUR_TO_SECOND => 112; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 107 | ▶ | use constant SQL_INTERVAL_MINUTE => 105; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 107 | ▶ | use constant SQL_INTERVAL_MINUTE_TO_SECOND => 113; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 107 | ▶ | use constant SQL_INTERVAL_MONTH => 102; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 107 | ▶ | use constant SQL_INTERVAL_SECOND => 106; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 107 | ▶ | use constant SQL_INTERVAL_YEAR => 101; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 107 | ▶ | use constant SQL_INTERVAL_YEAR_TO_MONTH => 107; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 107 | ▶ | use constant SQL_LONGVARBINARY => (-4); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 107 | ▶ | use constant SQL_LONGVARCHAR => (-1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 107 | ▶ | use constant SQL_MULTISET => 55; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 107 | ▶ | use constant SQL_MULTISET_LOCATOR => 56; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | 107 | ▶ | use constant SQL_NUMERIC => 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 107 | ▶ | use constant SQL_REAL => 7; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 107 | ▶ | use constant SQL_REF => 20; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 107 | ▶ | use constant SQL_ROW => 19; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 107 | ▶ | use constant SQL_SMALLINT => 5; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 107 | ▶ | use constant SQL_TIME => 10; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 107 | ▶ | use constant SQL_TIMESTAMP => 11; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 107 | ▶ | use constant SQL_TINYINT => (-6); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 107 | ▶ | use constant SQL_TYPE_DATE => 91; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 107 | ▶ | use constant SQL_TYPE_TIME => 92; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 107 | ▶ | use constant SQL_TYPE_TIMESTAMP => 93; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 107 | ▶ | use constant SQL_TYPE_TIMESTAMP_WITH_TIMEZONE => 95; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 107 | ▶ | use constant SQL_TYPE_TIME_WITH_TIMEZONE => 94; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 107 | ▶ | use constant SQL_UDT => 17; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 107 | ▶ | use constant SQL_UDT_LOCATOR => 18; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 107 | ▶ | use constant SQL_UNKNOWN_TYPE => 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 107 | ▶ | use constant SQL_VARBINARY => (-3); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 107 | ▶ | use constant SQL_VARCHAR => 12; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 107 | ▶ | use constant SQL_WCHAR => (-8); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 107 | ▶ | use constant SQL_WLONGVARCHAR => (-10); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 107 | ▶ | use constant SQL_WVARCHAR => (-9); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | # for Cursor types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | 107 | ▶ | use constant SQL_CURSOR_FORWARD_ONLY => 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 107 | ▶ | use constant SQL_CURSOR_KEYSET_DRIVEN => 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | 107 | ▶ | use constant SQL_CURSOR_DYNAMIC => 2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 107 | ▶ | use constant SQL_CURSOR_STATIC => 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 107 | ▶ | use constant SQL_CURSOR_TYPE_DEFAULT => SQL_CURSOR_FORWARD_ONLY; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 107 | ▶ | use constant IMA_HAS_USAGE => 0x0001; #/* check parameter usage */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 107 | ▶ | use constant IMA_FUNC_REDIRECT => 0x0002; #/* is $h->func(..., "method")*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 107 | ▶ | use constant IMA_KEEP_ERR => 0x0004; #/* don't reset err & errstr */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 107 | ▶ | use constant IMA_KEEP_ERR_SUB => 0x0008; #/* '' if in nested call */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 107 | ▶ | use constant IMA_NO_TAINT_IN => 0x0010; #/* don't check for tainted args*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 107 | ▶ | use constant IMA_NO_TAINT_OUT => 0x0020; #/* don't taint results */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 107 | ▶ | use constant IMA_COPY_UP_STMT => 0x0040; #/* copy sth Statement to dbh */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 107 | ▶ | use constant IMA_END_WORK => 0x0080; #/* set on commit & rollback */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 107 | ▶ | use constant IMA_STUB => 0x0100; #/* do nothing eg $dbh->connected */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | 107 | ▶ | use constant IMA_CLEAR_STMT => 0x0200; #/* clear Statement before call */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 107 | ▶ | use constant IMA_UNRELATED_TO_STMT=> 0x0400; #/* profile as empty Statement */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 107 | ▶ | use constant IMA_NOT_FOUND_OKAY => 0x0800; #/* not error if not found */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 107 | ▶ | use constant IMA_EXECUTE => 0x1000; #/* do/execute: DBIcf_Executed */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 107 | ▶ | use constant IMA_SHOW_ERR_STMT => 0x2000; #/* dbh meth relates to Statement*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 107 | ▶ | use constant IMA_HIDE_ERR_PARAMVALUES => 0x4000; #/* ParamValues are not relevant */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 107 | ▶ | use constant IMA_IS_FACTORY => 0x8000; #/* new h ie connect & prepare */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 107 | ▶ | use constant IMA_CLEAR_CACHED_KIDS => 0x10000; #/* clear CachedKids before call */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 107 | ▶ | use constant DBIstcf_STRICT => 0x0001; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 107 | ▶ | use constant DBIstcf_DISCARD_STRING => 0x0002; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 107 | my %is_flag_attribute = map {$_ =>1 } qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | Active | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | AutoCommit | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | ChopBlanks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | CompatMode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | Executed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | Taint | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | TaintIn | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | TaintOut | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | InactiveDestroy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | AutoInactiveDestroy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | LongTruncOk | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | MultiThread | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | PrintError | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | PrintWarn | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | RaiseError | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | RaiseWarn | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | ShowErrorStatement | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | Warn | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 107 | my %is_valid_attribute = map {$_ =>1 } (keys %is_flag_attribute, qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | ActiveKids | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | Attribution | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | BegunWork | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | CachedKids | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | Callbacks | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | ChildHandles | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | CursorName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | Database | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | DebugDispatch | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | Driver | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | Err | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | Errstr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | ErrCount | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | FetchHashKeyName | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | HandleError | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | HandleSetErr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | ImplementorClass | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | Kids | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | LongReadLen | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | NAME NAME_uc NAME_lc NAME_uc_hash NAME_lc_hash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | NULLABLE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | NUM_OF_FIELDS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | NUM_OF_PARAMS | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | Name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | PRECISION | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | ParamValues | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | Profile | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | Provider | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | ReadOnly | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | RootClass | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | RowCacheSize | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | RowsInCache | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | SCALE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | State | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | Statement | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | TYPE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | Type | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | TraceLevel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | Username | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | Version | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | )); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 0 | ▶ | sub valid_attribute { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
valid_attribute: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | ▶ | my $attr = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
valid_attribute: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | ▶ | return 1 if $is_valid_attribute{$attr}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 0 | ▶ | return 1 if $attr =~ m/^[a-z]/; # starts with lowercase letter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 0 | return 0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 107 | my $initial_setup; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 107 | ▶ | sub initial_setup { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
initial_setup: called CC=2 SCAR=10.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 0 | ▶ | $initial_setup = 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
initial_setup: not called CC=2 SCAR=10.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 0 | ▶ | print $DBI::tfh __FILE__ . " version " . $DBI::PurePerl::VERSION . "\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | if $DBI::dbi_debug & 0xF; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | 0 | untie $DBI::err; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 0 | untie $DBI::errstr; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 0 | untie $DBI::state; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 0 | untie $DBI::rows; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | #tie $DBI::lasth, 'DBI::var', '!lasth'; # special case: return boolean | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | 10076 | ▶ | sub _install_method { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_install_method: called CC=26 SCAR=48.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 0 | ▶ | my ( $caller, $method, $from, $param_hash ) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_install_method: not called CC=26 SCAR=48.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 0 | ▶ | initial_setup() unless $initial_setup; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | 0 | my ($class, $method_name) = $method =~ /^[^:]+::(.+)::(.+)$/; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | 0 | ▶ | my $bitmask = $param_hash->{'O'} || 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$param_hash->{'O'} || 0
$param_hash->{'O'} || 0
MC/DC100%1/1
$param_hash->{'O'} || 0
$param_hash->{'O'}
MC/DC0%0/1
$param_hash->{'O'} || 0
$param_hash->{'O'}
Truth table100%2/2
A
A= $param_hash->{'O'}
Truth table0%0/2
A
A= $param_hash->{'O'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 0 | my @pre_call_frag; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | 0 | ▶ | return if $method_name eq 'can'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 0 | ▶ | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | delete $h->{CachedKids}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | # ignore DESTROY for outer handle (DESTROY for inner likely to follow soon) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | return if $h_inner; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | # handle AutoInactiveDestroy and InactiveDestroy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | $h->{InactiveDestroy} = 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | if $h->{AutoInactiveDestroy} and $$ != $h->{dbi_pp_pid}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | $h->{Active} = 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | if $h->{InactiveDestroy}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | # copy err/errstr/state up to driver so $DBI::err etc still work | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | if ($h->{err} and my $drh = $h->{Driver}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | $drh->{$_} = $h->{$_} for ('err','errstr','state'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | } if $method_name eq 'DESTROY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | return $h->{$_[0]} if exists $h->{$_[0]}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | 0 | ▶ | } if $method_name eq 'FETCH' && !exists $ENV{DBI_TRACE}; # XXX ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%3/6
$method_name eq "FETCH" and not exists $ENV{"DBI_TRACE"}
$method_name eq "FETCH" and not exists $ENV{"DBI_TRACE"}
MC/DC100%2/2
$method_name eq "FETCH" and not exists $ENV{"DBI_TRACE"}
$method_name eq "FETCH"
not exists $ENV{"DBI_TRACE"}
MC/DC0%0/2
$method_name eq "FETCH" and not exists $ENV{"DBI_TRACE"}
$method_name eq "FETCH"
not exists $ENV{"DBI_TRACE"}
Truth table100%3/3
A and not(B)
A= $method_name eq "FETCH"B= not exists $ENV{"DBI_TRACE"}
Truth table0%0/3
A and not(B)
A= $method_name eq "FETCH"B= not exists $ENV{"DBI_TRACE"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 0 | ▶ | push @pre_call_frag, "return;" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | if IMA_STUB & $bitmask; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 0 | ▶ | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | $method_name = pop @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | } if IMA_FUNC_REDIRECT & $bitmask; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 0 | ▶ | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | my $parent_dbh = $h->{Database}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | } if (IMA_COPY_UP_STMT|IMA_EXECUTE) & $bitmask; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 0 | ▶ | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | warn "No Database set for $h on $method_name!" unless $parent_dbh; # eg proxy problems | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | $parent_dbh->{Statement} = $h->{Statement} if $parent_dbh; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | } if IMA_COPY_UP_STMT & $bitmask; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 0 | ▶ | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | $h->{Executed} = 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | $parent_dbh->{Executed} = 1 if $parent_dbh; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | } if IMA_EXECUTE & $bitmask; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 0 | ▶ | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | %{ $h->{CachedKids} } = () if $h->{CachedKids}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | } if IMA_CLEAR_CACHED_KIDS & $bitmask; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 0 | ▶ | if (IMA_KEEP_ERR & $bitmask) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 0 | push @pre_call_frag, q{ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | my $keep_error = DBI::_err_hash($h); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 0 | ▶ | my $ke_init = (IMA_KEEP_ERR_SUB & $bitmask) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | ? q{= ($h->{dbi_pp_parent}->{dbi_pp_call_depth} && DBI::_err_hash($h)) } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | : ""; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | 0 | push @pre_call_frag, qq{ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | my \$keep_error $ke_init; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 0 | my $clear_error_code = q{ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | #warn "$method_name cleared err"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | $h->{err} = $DBI::err = undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | $h->{errstr} = $DBI::errstr = undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | $h->{state} = $DBI::state = ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | $clear_error_code = q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | printf $DBI::tfh " !! %s: %s CLEARED by call to }.$method_name.q{ method\n". | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | $h->{err}, $h->{err} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | if defined $h->{err} && $DBI::dbi_debug & 0xF; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | }. $clear_error_code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 0 | ▶ | if exists $ENV{DBI_TRACE}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 0 | ▶ | push @pre_call_frag, ($ke_init) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | ? qq{ unless (\$keep_error) { $clear_error_code }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | : $clear_error_code | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | unless $method_name eq 'set_err'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 0 | push @pre_call_frag, q{ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | my $ErrCount = $h->{ErrCount}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | if (($DBI::dbi_debug & 0xF) >= 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | no warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | my $args = join " ", map { DBI::neat($_) } ($h, @_); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | printf $DBI::tfh " > $method_name in $imp ($args) [$@]\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 0 | ▶ | } if exists $ENV{DBI_TRACE}; # note use of 'exists' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | push @pre_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | $h->{'dbi_pp_last_method'} = $method_name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 0 | ▶ | } unless exists $DBI::last_method_except{$method_name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | # --- post method call code fragments --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 0 | my @post_call_frag; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | push @post_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | if (my $trace_level = ($DBI::dbi_debug & 0xF)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | if ($h->{err}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | printf $DBI::tfh " !! ERROR: %s %s\n", $h->{err}, $h->{errstr}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | my $ret = join " ", map { DBI::neat($_) } @ret; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | my $msg = " < $method_name= $ret"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | $msg = ($trace_level >= 2) ? Carp::shortmess($msg) : "$msg\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | print $DBI::tfh $msg; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 0 | ▶ | } if exists $ENV{DBI_TRACE}; # note use of exists | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | 0 | ▶ | push @post_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | $h->{Executed} = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | if ($h->{BegunWork}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | $h->{BegunWork} = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | $h->{AutoCommit} = 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | } if IMA_END_WORK & $bitmask; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 0 | ▶ | push @post_call_frag, q{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | if ( ref $ret[0] and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | UNIVERSAL::isa($ret[0], 'DBI::_::common') and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | defined( (my $h_new = tied(%{$ret[0]})||$ret[0])->{err} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | # copy up info/warn to drh so PrintWarn on connect is triggered | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | $h->set_err($h_new->{err}, $h_new->{errstr}, $h_new->{state}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | } if IMA_IS_FACTORY & $bitmask; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | 0 | push @post_call_frag, q{ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | if ($keep_error) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | $keep_error = 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | if $h->{ErrCount} > $ErrCount | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | or DBI::_err_hash($h) ne $keep_error; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | $DBI::err = $h->{err}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | $DBI::errstr = $h->{errstr}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | $DBI::state = $h->{state}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | if ( !$keep_error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | && defined(my $err = $h->{err}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | && ($call_depth <= 1 && !$h->{dbi_pp_parent}{dbi_pp_call_depth}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | my($pe,$pw,$re,$rw,$he) = @{$h}{qw(PrintError PrintWarn RaiseError RaiseWarn HandleError)}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | my $msg; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | if ($err && ($pe || $re || $he) # error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | or (!$err && length($err) && ($pw || $rw)) # warning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | my $last = ($DBI::last_method_except{$method_name}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | ? ($h->{'dbi_pp_last_method'}||$method_name) : $method_name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | my $errstr = $h->{errstr} || $DBI::errstr || $err || ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | my $msg = sprintf "%s %s %s: %s", $imp, $last, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | ($err eq "0") ? "warning" : "failed", $errstr; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | if ($h->{'ShowErrorStatement'} and my $Statement = $h->{Statement}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | $msg .= ' [for Statement "' . $Statement; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | if (my $ParamValues = $h->FETCH('ParamValues')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | $msg .= '" with ParamValues: '; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | $msg .= DBI::_concat_hash_sorted($ParamValues, "=", ", ", 1, undef); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | $msg .= "]"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | $msg .= '"]'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | if ($err eq "0") { # is 'warning' (not info) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | carp $msg if $pw; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | my $do_croak = $rw; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | if ((my $subsub = $h->{'HandleError'}) && $do_croak) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | $do_croak = 0 if &$subsub($msg,$h,$ret[0]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | die $msg if $do_croak; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | my $do_croak = 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | if (my $subsub = $h->{'HandleError'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | $do_croak = 0 if &$subsub($msg,$h,$ret[0]); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | if ($do_croak) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | printf $DBI::tfh " $method_name has failed ($h->{PrintError},$h->{RaiseError})\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | if ($DBI::dbi_debug & 0xF) >= 4; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | carp $msg if $pe; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | die $msg if $h->{RaiseError}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 0 | ▶ | my $method_code = q[ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | my $h = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | my $h_inner = tied(%$h); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | $h = $h_inner if $h_inner; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | my $imp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | if ($method_name eq 'DESTROY') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | # during global destruction, $h->{...} can trigger "Can't call FETCH on an undef value" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | # implying that tied() above lied to us, so we need to use eval | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | local $@; # protect $@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | $imp = eval { $h->{"ImplementorClass"} } or return; # probably global destruction | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | $imp = $h->{"ImplementorClass"} or do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | warn "Can't call $method_name method on handle $h after take_imp_data()\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | if not exists $h->{Active}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | return; # or, more likely, global destruction | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | ] . join("\n", '', @pre_call_frag, '') . q[ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | my $call_depth = $h->{'dbi_pp_call_depth'} + 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | local ($h->{'dbi_pp_call_depth'}) = $call_depth; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | my @ret; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | my $sub = $imp->can($method_name); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | if (!$sub and IMA_FUNC_REDIRECT & $bitmask and $sub = $imp->can('func')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | push @_, $method_name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | if ($sub) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | (wantarray) ? (@ret = &$sub($h,@_)) : (@ret = scalar &$sub($h,@_)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | # XXX could try explicit fallback to $imp->can('AUTOLOAD') etc | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | # which would then let Multiplex pass PurePerl tests, but some | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | # hook into install_method may be better. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | croak "Can't locate DBI object method \"$method_name\" via package \"$imp\"" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | if ] . ((IMA_NOT_FOUND_OKAY & $bitmask) ? 0 : 1) . q[; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | ] . join("\n", '', @post_call_frag, '') . q[ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | return (wantarray) ? @ret : $ret[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 107 | ▶ | no strict qw(refs); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | 0 | my $code_ref = eval qq{#line 1 "DBI::PurePerl $method"\n$method_code}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 0 | ▶ | warn "$@\n$method_code\n" if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | 0 | ▶ | die "$@\n$method_code\n" if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | 0 | *$method = $code_ref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | 0 | if (0 && $method =~ /\b(connect|FETCH)\b/) { # debuging tool | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | my $l=0; # show line-numbered code for method | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | warn "*$method code:\n".join("\n", map { ++$l.": $_" } split/\n/,$method_code); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 3226 | ▶ | sub _new_handle { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_new_handle: called CC=5 SCAR=21.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 0 | ▶ | my ($class, $parent, $attr, $imp_data, $imp_class) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_new_handle: not called CC=5 SCAR=21.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | 0 | ▶ | DBI->trace_msg(" New $class (for $imp_class, parent=$parent, id=".($imp_data||'').")\n") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%2/4
$imp_data || ''
$imp_data || ''
MC/DC100%1/1
$imp_data || ''
$imp_data
MC/DC0%0/1
$imp_data || ''
$imp_data
Truth table100%2/2
A
A= $imp_data
Truth table0%0/2
A
A= $imp_data
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | if $DBI::dbi_debug >= 3; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | 0 | ▶ | $attr->{ImplementorClass} = $imp_class | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | or Carp::croak("_new_handle($class): 'ImplementorClass' attribute not given"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | # This is how we create a DBI style Object: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | # %outer gets tied to %$attr (which becomes the 'inner' handle) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 0 | my (%outer, $i, $h); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | 0 | $i = tie %outer, $class, $attr; # ref to inner hash (for driver) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | 0 | $h = bless \%outer, $class; # ref to outer hash (for application) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | # The above tie and bless may migrate down into _setup_handle()... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | # Now add magic so DBI method dispatch works | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | 0 | DBI::_setup_handle($h, $imp_class, $parent, $imp_data); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | 0 | ▶ | return $h unless wantarray; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | 0 | return ($h, $i); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | 3226 | ▶ | sub _setup_handle { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_setup_handle: called CC=18 SCAR=43.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | 0 | ▶ | my($h, $imp_class, $parent, $imp_data) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_setup_handle: not called CC=18 SCAR=43.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | 0 | ▶ | my $h_inner = tied(%$h) || $h; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition16%1/6
tied %$h || $h
tied %$h || $h
MC/DC0%0/2
tied %$h || $h
tied %$h
$h
MC/DC0%0/2
tied %$h || $h
tied %$h
$h
Truth table33%1/3
A || B
A= tied %$hB= $h
Truth table0%0/3
A || B
A= tied %$hB= $h
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | 0 | ▶ | if (($DBI::dbi_debug & 0xF) >= 4) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | 107 | ▶ | no warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | 0 | print $DBI::tfh " _setup_handle(@_)\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | 0 | $h_inner->{"imp_data"} = $imp_data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | 0 | $h_inner->{"ImplementorClass"} = $imp_class; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | 0 | $h_inner->{"Kids"} = $h_inner->{"ActiveKids"} = 0; # XXX not maintained | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | 0 | ▶ | if ($parent) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | 0 | foreach (qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | RaiseError PrintError RaiseWarn PrintWarn HandleError HandleSetErr | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | Warn LongTruncOk ChopBlanks AutoCommit ReadOnly | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | ShowErrorStatement FetchHashKeyName LongReadLen CompatMode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | )) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | $h_inner->{$_} = $parent->{$_} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 0 | ▶ | if exists $parent->{$_} && !exists $h_inner->{$_}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%2/6
exists $parent->{$_} and not exists $h_inner->{$_}
exists $parent->{$_} and not exists $h_inner->{$_}
MC/DC50%1/2
exists $parent->{$_} and not exists $h_inner->{$_}
exists $parent->{$_}
not exists $h_inner->{$_}
MC/DC0%0/2
exists $parent->{$_} and not exists $h_inner->{$_}
exists $parent->{$_}
not exists $h_inner->{$_}
Truth table66%2/3
A and not(B)
A= exists $parent->{$_}B= not exists $h_inner->{$_}
Truth table0%0/3
A and not(B)
A= exists $parent->{$_}B= not exists $h_inner->{$_}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | 0 | ▶ | if (ref($parent) =~ /::db$/) { # is sth | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | 0 | $h_inner->{Database} = $parent; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | 0 | $parent->{Statement} = $h_inner->{Statement}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | 0 | $h_inner->{NUM_OF_PARAMS} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | 0 | $h_inner->{Active} = 0; # driver sets true when there's data to fetch | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | elsif (ref($parent) =~ /::dr$/){ # is dbh | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | 0 | $h_inner->{Driver} = $parent; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | 0 | $h_inner->{Active} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | 0 | warn "panic: ".ref($parent); # should never happen | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | 0 | $h_inner->{dbi_pp_parent} = $parent; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | # add to the parent's ChildHandles | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | 0 | ▶ | if ($HAS_WEAKEN) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | 0 | ▶ | my $handles = $parent->{ChildHandles} ||= []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%2/4
$parent->{"ChildHandles"} ||= []
$parent->{"ChildHandles"} ||= []
MC/DC100%1/1
$parent->{"ChildHandles"} ||= []
$parent->{"ChildHandles"}
MC/DC0%0/1
$parent->{"ChildHandles"} ||= []
$parent->{"ChildHandles"}
Truth table100%2/2
A
A= $parent->{"ChildHandles"}
Truth table0%0/2
A
A= $parent->{"ChildHandles"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | 0 | push @$handles, $h; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | 0 | Scalar::Util::weaken($handles->[-1]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | # purge destroyed handles occasionally | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | 0 | ▶ | if (@$handles % 120 == 0) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 0 | @$handles = grep { defined } @$handles; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | 0 | Scalar::Util::weaken($_) for @$handles; # re-weaken after grep | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | else { # setting up a driver handle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | 0 | $h_inner->{Warn} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 0 | $h_inner->{PrintWarn} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | 0 | $h_inner->{AutoCommit} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | 0 | $h_inner->{TraceLevel} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | 0 | $h_inner->{CompatMode} = (1==0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | 0 | ▶ | $h_inner->{FetchHashKeyName} ||= 'NAME'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$h_inner->{"FetchHashKeyName"} ||= "NAME"
$h_inner->{"FetchHashKeyName"} ||= "NAME"
MC/DC0%0/1
$h_inner->{"FetchHashKeyName"} ||= "NAME"
$h_inner->{"FetchHashKeyName"}
MC/DC0%0/1
$h_inner->{"FetchHashKeyName"} ||= "NAME"
$h_inner->{"FetchHashKeyName"}
Truth table50%1/2
A
A= $h_inner->{"FetchHashKeyName"}
Truth table0%0/2
A
A= $h_inner->{"FetchHashKeyName"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | 0 | ▶ | $h_inner->{LongReadLen} ||= 80; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$h_inner->{"LongReadLen"} ||= 80
$h_inner->{"LongReadLen"} ||= 80
MC/DC0%0/1
$h_inner->{"LongReadLen"} ||= 80
$h_inner->{"LongReadLen"}
MC/DC0%0/1
$h_inner->{"LongReadLen"} ||= 80
$h_inner->{"LongReadLen"}
Truth table50%1/2
A
A= $h_inner->{"LongReadLen"}
Truth table0%0/2
A
A= $h_inner->{"LongReadLen"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | 0 | ▶ | $h_inner->{ChildHandles} ||= [] if $HAS_WEAKEN; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition25%1/4
$h_inner->{"ChildHandles"} ||= []
$h_inner->{"ChildHandles"} ||= []
MC/DC0%0/1
$h_inner->{"ChildHandles"} ||= []
$h_inner->{"ChildHandles"}
MC/DC0%0/1
$h_inner->{"ChildHandles"} ||= []
$h_inner->{"ChildHandles"}
Truth table50%1/2
A
A= $h_inner->{"ChildHandles"}
Truth table0%0/2
A
A= $h_inner->{"ChildHandles"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | 0 | ▶ | $h_inner->{Type} ||= 'dr'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition25%1/4
$h_inner->{"Type"} ||= "dr"
$h_inner->{"Type"} ||= "dr"
MC/DC0%0/1
$h_inner->{"Type"} ||= "dr"
$h_inner->{"Type"}
MC/DC0%0/1
$h_inner->{"Type"} ||= "dr"
$h_inner->{"Type"}
Truth table50%1/2
A
A= $h_inner->{"Type"}
Truth table0%0/2
A
A= $h_inner->{"Type"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | 0 | $h_inner->{Active} = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | 0 | $h_inner->{"dbi_pp_call_depth"} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | 0 | $h_inner->{"dbi_pp_pid"} = $$; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 0 | $h_inner->{ErrCount} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 0 | ▶ | sub constant { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
constant: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | 0 | ▶ | warn "constant(@_) called unexpectedly"; return undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
constant: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | 18 | ▶ | sub trace { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace: called CC=7 SCAR=27.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | 0 | ▶ | my ($h, $level, $file) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace: not called CC=7 SCAR=27.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | 0 | ▶ | $level = $h->parse_trace_flags($level) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%2/6
defined $level and not looks_like_number($level)
defined $level and not looks_like_number($level)
MC/DC0%0/2
defined $level and not looks_like_number($level)
defined $level
not looks_like_number($level)
MC/DC0%0/2
defined $level and not looks_like_number($level)
defined $level
not looks_like_number($level)
Truth table66%2/3
A and not(B)
A= defined $levelB= not looks_like_number($level)
Truth table0%0/3
A and not(B)
A= defined $levelB= not looks_like_number($level)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | if defined $level and !DBI::looks_like_number($level); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 0 | my $old_level = $DBI::dbi_debug; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | 0 | ▶ | _set_trace_file($file) if $level; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 0 | ▶ | if (defined $level) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | 0 | $DBI::dbi_debug = $level; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 0 | ▶ | print $DBI::tfh " DBI $DBI::VERSION (PurePerl) " | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | . "dispatch trace level set to $DBI::dbi_debug\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | if $DBI::dbi_debug & 0xF; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | 0 | ▶ | _set_trace_file($file) if !$level; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | 0 | return $old_level; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 38 | ▶ | sub _set_trace_file { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_set_trace_file: called CC=11 SCAR=33.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 0 | ▶ | my ($file) = @_; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_set_trace_file: not called CC=11 SCAR=33.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | # DAA add support for filehandle inputs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | # DAA required to avoid closing a prior fh trace() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 0 | ▶ | $DBI::tfh = undef unless $DBI::tfh_needs_close; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | 0 | ▶ | if (ref $file eq 'GLOB') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | 0 | $DBI::tfh = $file; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | 0 | select((select($DBI::tfh), $| = 1)[0]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | 0 | $DBI::tfh_needs_close = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | 0 | ▶ | if ($file && ref \$file eq 'GLOB') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition50%3/6
$file and ref \$file eq "GLOB"
$file and ref \$file eq "GLOB"
MC/DC100%2/2
$file and ref \$file eq "GLOB"
$file
ref \$file eq "GLOB"
MC/DC0%0/2
$file and ref \$file eq "GLOB"
$file
ref \$file eq "GLOB"
Truth table100%3/3
A and B
A= $fileB= ref \$file eq "GLOB"
Truth table0%0/3
A and B
A= $fileB= ref \$file eq "GLOB"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | 0 | $DBI::tfh = *{$file}{IO}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | 0 | select((select($DBI::tfh), $| = 1)[0]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | 0 | $DBI::tfh_needs_close = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | 0 | $DBI::tfh_needs_close = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | 0 | ▶ | if (!$file || $file eq 'STDERR') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition50%3/6
not $file or $file eq "STDERR"
not $file or $file eq "STDERR"
MC/DC100%2/2
not $file or $file eq "STDERR"
not $file
$file eq "STDERR"
MC/DC0%0/2
not $file or $file eq "STDERR"
not $file
$file eq "STDERR"
Truth table100%3/3
not(A) or B
A= not $fileB= $file eq "STDERR"
Truth table0%0/3
not(A) or B
A= not $fileB= $file eq "STDERR"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | 0 | ▶ | open $DBI::tfh, ">&STDERR" or carp "Can't dup STDERR: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | elsif ($file eq 'STDOUT') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | 0 | ▶ | open $DBI::tfh, ">&STDOUT" or carp "Can't dup STDOUT: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | 0 | ▶ | open $DBI::tfh, ">>$file" or carp "Can't open $file: $!"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | 0 | select((select($DBI::tfh), $| = 1)[0]); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | 2 | ▶ | sub _get_imp_data { shift->{"imp_data"}; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_imp_data: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | 0 | ▶ | sub _svdump { } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_svdump: not called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | 4 | ▶ | sub dump_handle { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dump_handle: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | 4 | my ($h,$msg,$level) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | 4 | ▶ | $msg||="dump_handle $h"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$msg ||= "dump_handle $h"
MC/DC0%0/1
$msg ||= "dump_handle $h"
$msg
Truth table50%1/2
A
A= $msg
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | 4 | print $DBI::tfh "$msg:\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | 4 | for my $attrib (sort keys %$h) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | 136 | print $DBI::tfh "\t$attrib => ".DBI::neat($h->{$attrib})."\n"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | 14 | ▶ | sub _handles { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_handles: called CC=4 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | 14 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | 14 | my $h_inner = tied %$h; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | 14 | ▶ | if ($h_inner) { # this is okay | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | 14 | ▶ | return $h unless wantarray; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | 14 | return ($h, $h_inner); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | # XXX this isn't okay... we have an inner handle but | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | # currently have no way to get at its outer handle, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | # so we just warn and return the inner one for both... | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | 0 | Carp::carp("Can't return outer handle from inner handle using DBI::PurePerl"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | 0 | ▶ | return $h unless wantarray; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | 0 | return ($h,$h); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | 8 | ▶ | sub hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hash: called CC=7 SCAR=19.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | 8 | my ($key, $type) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | 8 | my ($hash); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | 8 | ▶ | if (!$type) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | 6 | $hash = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | # XXX The C version uses the "char" type, which could be either | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | # signed or unsigned. I use signed because so do the two | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | # compilers on my system. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | 6 | for my $char (unpack ("c*", $key)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | 24 | $hash = $hash * 33 + $char; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | 6 | $hash &= 0x7FFFFFFF; # limit to 31 bits | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | 6 | $hash |= 0x40000000; # set bit 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | 6 | return -$hash; # return negative int | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | elsif ($type == 1) { # Fowler/Noll/Vo hash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | # see http://www.isthe.com/chongo/tech/comp/fnv/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | 2 | require Math::BigInt; # feel free to reimplement w/o BigInt! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | 2 | ▶ | (my $version = $Math::BigInt::VERSION || 0) =~ s/_.*//; # eg "1.70_01" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$Math::BigInt::VERSION || 0
MC/DC0%0/1
$Math::BigInt::VERSION || 0
$Math::BigInt::VERSION
Truth table50%1/2
A
A= $Math::BigInt::VERSION
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | 2 | ▶ | if ($version >= 1.56) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | 2 | $hash = Math::BigInt->new(0x811c9dc5); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | 2 | for my $uchar (unpack ("C*", $key)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | # multiply by the 32 bit FNV magic prime mod 2^64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | 10 | $hash = ($hash * 0x01000193) & 0xffffffff; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | # xor the bottom with the current octet | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | 10 | $hash ^= $uchar; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | # cast to int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | 2 | return unpack "i", pack "i", $hash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | 0 | croak("DBI::PurePerl doesn't support hash type 1 without Math::BigInt >= 1.56 (available on CPAN)"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | 0 | croak("bad hash type $type"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | 5002 | ▶ | sub looks_like_number { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
looks_like_number: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | 5002 | my @new = (); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | 5002 | for my $thing(@_) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | 5014 | ▶ | if (!defined $thing or $thing eq '') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not defined $thing or $thing eq ""
MC/DC100%2/2
not defined $thing or $thing eq ""
not defined $thing
$thing eq ""
Truth table100%3/3
not(A) or B
A= not defined $thingB= $thing eq ""
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | 20 | push @new, undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | 4994 | ▶ | push @new, ($thing =~ /^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/) ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | 5002 | ▶ | return (@_ >1) ? @new : $new[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | 5613 | ▶ | sub neat { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
neat: called CC=7 SCAR=19.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | 5613 | my $v = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | 5613 | ▶ | return "undef" unless defined $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | 1231 | my $quote = q{"}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 685 | 1231 | ▶ | if (not utf8::is_utf8($v)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 686 | 1231 | ▶ | return $v if (($v & ~ $v) eq "0"); # is SvNIOK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 687 | 618 | $quote = q{'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 688 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 689 | 618 | ▶ | my $maxlen = shift || $DBI::neat_maxlen; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
shift() || $DBI::neat_maxlen
MC/DC0%0/2
shift() || $DBI::neat_maxlen
shift()
$DBI::neat_maxlen
Truth table66%2/3
A || B
A= shift()B= $DBI::neat_maxlen
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 690 | 618 | ▶ | if ($maxlen && $maxlen < length($v) + 2) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$maxlen and $maxlen < length($v) + 2
MC/DC50%1/2
$maxlen and $maxlen < length($v) + 2
$maxlen
$maxlen < length($v) + 2
Truth table66%2/3
A and B
A= $maxlenB= $maxlen < length($v) + 2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 691 | 10 | $v = substr($v,0,$maxlen-5); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 692 | 10 | $v .= '...'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 693 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 694 | 618 | $v =~ s/[^[:print:]]/./g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 695 | 618 | return "$quote$v$quote"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 696 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 697 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 698 | 42 | ▶ | sub sql_type_cast { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
sql_type_cast: called CC=12 SCAR=24.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 699 | 42 | my (undef, $sql_type, $flags) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 700 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 701 | 42 | ▶ | return -1 unless defined $_[0]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 702 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 703 | 40 | my $cast_ok = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 704 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 705 | 40 | ▶ | my $evalret = eval { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
(my $evalret = eval {
do {
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x5d\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
if ($sql_type == 4) {
my $dummy = $_[0] + 0;
return 1;
}
elsif ($sql_type == 8) {
my $dummy = $_[0] + 0.0;
return 1;
}
elsif ($sql_type == 2) {
my $dummy = $_[0] + 0.0;
return 1;
}
else {
return -2;
}
}
}) || $^W && warn($@)
MC/DC0%0/2
(my $evalret = eval {
do {
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x5d\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
if ($sql_type == 4) {
my $dummy = $_[0] + 0;
return 1;
}
elsif ($sql_type == 8) {
my $dummy = $_[0] + 0.0;
return 1;
}
elsif ($sql_type == 2) {
my $dummy = $_[0] + 0.0;
return 1;
}
else {
return -2;
}
}
}) || $^W && warn($@)
(my $evalret = eval {
do {
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x5d\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
if ($sql_type == 4) {
my $dummy = $_[0] + 0;
return 1;
}
elsif ($sql_type == 8) {
my $dummy = $_[0] + 0.0;
return 1;
}
elsif ($sql_type == 2) {
my $dummy = $_[0] + 0.0;
return 1;
}
else {
return -2;
}
}
})
$^W && warn($@)
Truth table66%2/3
A || B
A= (my $evalret = eval {
do {
BEGIN {${^WARNING_BITS} = "\x55\x55\x55\x5d\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55"}
if ($sql_type == 4) {
my $dummy = $_[0] + 0;
return 1;
}
elsif ($sql_type == 8) {
my $dummy = $_[0] + 0.0;
return 1;
}
elsif ($sql_type == 2) {
my $dummy = $_[0] + 0.0;
return 1;
}
else {
return -2;
}
}
})B= $^W && warn($@)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 706 | 107 | ▶ | use warnings FATAL => qw(numeric); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 707 | 40 | ▶ | if ($sql_type == SQL_INTEGER) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 708 | 28 | my $dummy = $_[0] + 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 709 | 24 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 710 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 711 | elsif ($sql_type == SQL_DOUBLE) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 712 | 4 | my $dummy = $_[0] + 0.0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 713 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 714 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 715 | elsif ($sql_type == SQL_NUMERIC) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 716 | 4 | my $dummy = $_[0] + 0.0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 717 | 0 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 718 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 719 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 720 | 4 | ▶ | return -2; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$^W and warn $@
MC/DC0%0/1
$^W and warn $@
$^W
Truth table50%1/2
A
A= $^W
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 721 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 722 | } or $^W && warn $@; # XXX warnings::warnif("numeric", $@) ? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 723 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 724 | 40 | ▶ | return $evalret if defined($evalret) && ($evalret == -2); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $evalret and $evalret == -2
MC/DC100%2/2
defined $evalret and $evalret == -2
defined $evalret
$evalret == -2
Truth table100%3/3
A and B
A= defined $evalretB= $evalret == -2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 725 | 36 | ▶ | $cast_ok = 0 unless $evalret; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 726 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 727 | # DBIstcf_DISCARD_STRING not supported for PurePerl currently | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 728 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 729 | 36 | ▶ | return 2 if $cast_ok; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 730 | 12 | ▶ | return 0 if $flags & DBIstcf_STRICT; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 731 | 6 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 732 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 733 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 734 | 0 | ▶ | sub dbi_time { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dbi_time: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 735 | 0 | return time(); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 736 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 737 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 738 | 3226 | ▶ | sub DBI::st::TIEHASH { bless $_[1] => $_[0] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
TIEHASH: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 739 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 740 | 228 | ▶ | sub _concat_hash_sorted { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_concat_hash_sorted: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 741 | 228 | my ( $hash_ref, $kv_separator, $pair_separator, $use_neat, $num_sort ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 742 | # $num_sort: 0=lexical, 1=numeric, undef=try to guess | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 743 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 744 | 228 | ▶ | return undef unless defined $hash_ref; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 745 | 213 | ▶ | die "hash is not a hash reference" unless ref $hash_ref eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 746 | 211 | my $keys = _get_sorted_hash_keys($hash_ref, $num_sort); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 747 | 211 | my $string = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 748 | 211 | for my $key (@$keys) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 749 | 5632 | ▶ | $string .= $pair_separator if length $string > 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 750 | 5632 | my $value = $hash_ref->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 751 | 5632 | ▶ | if ($use_neat) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 752 | 4412 | $value = DBI::neat($value, 0); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 753 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 754 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 755 | 1220 | ▶ | $value = (defined $value) ? "'$value'" : 'undef'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 756 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 757 | 5632 | $string .= $key . $kv_separator . $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 758 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 759 | 211 | return $string; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 760 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 761 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 762 | 211 | ▶ | sub _get_sorted_hash_keys { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_sorted_hash_keys: called CC=6 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 763 | 211 | my ($hash_ref, $num_sort) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 764 | 211 | ▶ | if (not defined $num_sort) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 765 | 50 | my $sort_guess = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 766 | $sort_guess = (not looks_like_number($_)) ? 0 : $sort_guess | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 767 | 50 | ▶ | for keys %$hash_ref; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 768 | 50 | $num_sort = $sort_guess; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 769 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 770 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 771 | 211 | my @keys = keys %$hash_ref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 772 | 107 | ▶ | no warnings 'numeric'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 773 | my @sorted = ($num_sort) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 774 | 211 | ▶ | ? sort { $a <=> $b or $a cmp $b } @keys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$a <=> $b || $a cmp $b
MC/DC0%0/2
$a <=> $b || $a cmp $b
$a <=> $b
$a cmp $b
Truth table66%2/3
A || B
A= $a <=> $bB= $a cmp $b
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 775 | : sort @keys; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 776 | 211 | return \@sorted; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 777 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 778 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 779 | 78594 | ▶ | sub _err_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_err_hash: called CC=3 SCAR=11.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 780 | 78594 | ▶ | return 1 unless defined $_[0]->{err}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 781 | 1117 | ▶ | return join " " => $_[0]->{err}, $_[0]->{errstr} // "?"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$_[0]{"errstr"} // "?"
MC/DC0%0/1
$_[0]{"errstr"} // "?"
$_[0]{"errstr"}
Truth table50%1/2
A
A= $_[0]{"errstr"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 782 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 783 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 784 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 785 | package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 786 | DBI::var; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 787 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 788 | 0 | ▶ | sub FETCH { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
FETCH: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 789 | 0 | my($key)=shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 790 | 0 | ▶ | return $DBI::err if $$key eq '*err'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 791 | 0 | ▶ | return $DBI::errstr if $$key eq '&errstr'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 792 | 0 | Carp::confess("FETCH $key not supported when using DBI::PurePerl"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 793 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 794 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 795 | package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 796 | DBD::_::common; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 797 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 798 | 0 | ▶ | sub swap_inner_handle { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
swap_inner_handle: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 799 | 0 | my ($h1, $h2) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 800 | # can't make this work till we can get the outer handle from the inner one | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 801 | # probably via a WeakRef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 802 | 0 | return $h1->set_err($DBI::stderr, "swap_inner_handle not currently supported by DBI::PurePerl"); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 803 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 804 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 805 | 160 | ▶ | sub trace { # XXX should set per-handle level, not global | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 806 | 160 | my ($h, $level, $file) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 807 | 160 | ▶ | $level = $h->parse_trace_flags($level) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $level and not DBI::looks_like_number($level)
MC/DC100%2/2
defined $level and not DBI::looks_like_number($level)
defined $level
not DBI::looks_like_number($level)
Truth table100%3/3
A and not(B)
A= defined $levelB= not DBI::looks_like_number($level)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 808 | if defined $level and !DBI::looks_like_number($level); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 809 | 160 | my $old_level = $DBI::dbi_debug; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 810 | 160 | ▶ | DBI::_set_trace_file($file) if defined $file; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 811 | 160 | ▶ | if (defined $level) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 812 | 116 | $DBI::dbi_debug = $level; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 813 | 116 | ▶ | if ($DBI::dbi_debug) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 814 | 78 | printf $DBI::tfh | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 815 | " %s trace level set to %d in DBI $DBI::VERSION (PurePerl)\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 816 | $h, $DBI::dbi_debug; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 817 | print $DBI::tfh " Full trace not available because DBI_TRACE is not in environment\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 818 | 78 | ▶ | unless exists $ENV{DBI_TRACE}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 819 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 820 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 821 | 160 | return $old_level; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 822 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 823 | 107 | *debug = \&trace; *debug = \&trace; # twice to avoid typo warning | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 824 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 825 | 4743 | ▶ | sub FETCH { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
FETCH: called CC=21 SCAR=30.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 826 | 4743 | my($h,$key)= @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 827 | 4743 | my $v = $h->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 828 | #warn ((exists $h->{$key}) ? "$key=$v\n" : "$key NONEXISTANT\n"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 829 | 4743 | ▶ | return $v if defined $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 830 | 4002 | ▶ | if ($key =~ /^NAME_.c$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 831 | 111 | my $cols = $h->FETCH('NAME'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 832 | 111 | ▶ | return undef unless $cols; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 833 | 107 | my @lcols = map { lc $_ } @$cols; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 834 | 107 | $h->{NAME_lc} = \@lcols; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 835 | 107 | my @ucols = map { uc $_ } @$cols; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 836 | 107 | $h->{NAME_uc} = \@ucols; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 837 | 107 | return $h->FETCH($key); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 838 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 839 | 3891 | ▶ | if ($key =~ /^NAME.*_hash$/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 840 | 60 | my $i=0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 841 | 60 | ▶ | for my $c(@{$h->FETCH('NAME')||[]}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$h->FETCH('NAME') || []
MC/DC100%1/1
$h->FETCH('NAME') || []
$h->FETCH('NAME')
Truth table100%2/2
A
A= $h->FETCH('NAME')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 842 | 124 | $h->{'NAME_hash'}->{$c} = $i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 843 | 124 | $h->{'NAME_lc_hash'}->{"\L$c"} = $i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 844 | 124 | $h->{'NAME_uc_hash'}->{"\U$c"} = $i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 845 | 124 | $i++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 846 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 847 | 60 | return $h->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 848 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 849 | 3831 | ▶ | if (!defined $v && !exists $h->{$key}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $v or exists $h->{$key}
MC/DC0%0/2
defined $v or exists $h->{$key}
defined $v
exists $h->{$key}
Truth table33%1/3
A or B
A= defined $vB= exists $h->{$key}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 850 | 3831 | ▶ | return ($h->FETCH('TaintIn') && $h->FETCH('TaintOut')) if $key eq'Taint'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$h->FETCH('TaintIn') && $h->FETCH('TaintOut')
MC/DC0%0/2
$h->FETCH('TaintIn') && $h->FETCH('TaintOut')
$h->FETCH('TaintIn')
$h->FETCH('TaintOut')
Truth table33%1/3
A && B
A= $h->FETCH('TaintIn')B= $h->FETCH('TaintOut')
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 851 | 3823 | ▶ | return (1==0) if $is_flag_attribute{$key}; # return perl-style sv_no, not undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 852 | 2527 | ▶ | return $DBI::dbi_debug if $key eq 'TraceLevel'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 853 | 2429 | ▶ | return [] if $key eq 'ChildHandles' && $HAS_WEAKEN; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$key eq "ChildHandles" and $HAS_WEAKEN
MC/DC50%1/2
$key eq "ChildHandles" and $HAS_WEAKEN
$key eq "ChildHandles"
$HAS_WEAKEN
Truth table66%2/3
A and B
A= $key eq "ChildHandles"B= $HAS_WEAKEN
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 854 | 2387 | ▶ | if ($key eq 'Type') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 855 | 50 | ▶ | return "dr" if $h->isa('DBI::dr'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 856 | 50 | ▶ | return "db" if $h->isa('DBI::db'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 857 | 44 | ▶ | return "st" if $h->isa('DBI::st'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 858 | 0 | Carp::carp( sprintf "Can't determine Type for %s",$h ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 859 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 860 | 2337 | ▶ | if (!$is_valid_attribute{$key} and $key =~ m/^[A-Z]/) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not $is_valid_attribute{$key} and $key =~ /^[A-Z]/
MC/DC100%2/2
not $is_valid_attribute{$key} and $key =~ /^[A-Z]/
not $is_valid_attribute{$key}
$key =~ /^[A-Z]/
Truth table100%3/3
not(A) and B
A= not $is_valid_attribute{$key}B= $key =~ /^[A-Z]/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 861 | 107 | ▶ | no warnings; # hide undef warnings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 862 | 2 | Carp::carp( sprintf "Can't get %s->{%s}: unrecognised attribute (@{[ %$h ]})",$h,$key ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 863 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 864 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 865 | 2337 | return $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 866 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 867 | 14435 | ▶ | sub STORE { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
STORE: called CC=15 SCAR=27.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 868 | 14435 | my ($h,$key,$value) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 869 | 14435 | ▶ | if ($key eq 'AutoCommit') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 870 | 584 | ▶ | Carp::croak("DBD driver has not implemented the AutoCommit attribute") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$value == -900 or $value == -901
MC/DC0%0/2
$value == -900 or $value == -901
$value == -900
$value == -901
Truth table66%2/3
A or B
A= $value == -900B= $value == -901
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 871 | unless $value == -900 || $value == -901; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 872 | 584 | $value = ($value == -901); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 873 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 874 | elsif ($key =~ /^Taint/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 875 | 24 | ▶ | Carp::croak(sprintf "Can't set %s->{%s}: Taint mode not supported by DBI::PurePerl",$h,$key) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 876 | if $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 877 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 878 | elsif ($key eq 'TraceLevel') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 879 | 94 | $h->trace($value); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 880 | 94 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 881 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 882 | elsif ($key eq 'NUM_OF_FIELDS') { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 883 | 2246 | $h->{$key} = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 884 | 2246 | ▶ | if ($value) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 885 | 1691 | my $fbav = DBD::_::st::dbih_setup_fbav($h); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 886 | 1691 | ▶ | @$fbav = (undef) x $value if @$fbav != $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 887 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 888 | 2246 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 889 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 890 | ▶ | elsif (!$is_valid_attribute{$key} && $key =~ /^[A-Z]/ && !exists $h->{$key}) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%6/6
not $is_valid_attribute{$key} and $key =~ /^[A-Z]/ and not exists $h->{$key}
not $is_valid_attribute{$key} and $key =~ /^[A-Z]/
MC/DC100%3/3
not $is_valid_attribute{$key} and $key =~ /^[A-Z]/ and not exists $h->{$key}
not $is_valid_attribute{$key}
$key =~ /^[A-Z]/
not exists $h->{$key}
Truth table100%4/4
not(A) and B and not(C)
A= not $is_valid_attribute{$key}B= $key =~ /^[A-Z]/C= not exists $h->{$key}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 891 | 2 | Carp::carp(sprintf "Can't set %s->{%s}: unrecognised attribute or invalid value %s", | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 892 | $h,$key,$value); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 893 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 894 | 12095 | ▶ | $h->{$key} = $is_flag_attribute{$key} ? !!$value : $value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 895 | 12095 | ▶ | Scalar::Util::weaken($h->{$key}) if $key eq 'CachedKids'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 896 | 12095 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 897 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 898 | 4 | ▶ | sub DELETE { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DELETE: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 899 | 4 | my ($h, $key) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 900 | 4 | ▶ | return $h->FETCH($key) unless $key =~ /^private_/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 901 | 2 | return delete $h->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 902 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 903 | 101 | ▶ | sub err { return shift->{err} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
err: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 904 | 114 | ▶ | sub errstr { return shift->{errstr} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
errstr: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 905 | 10 | ▶ | sub state { return shift->{state} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
state: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 906 | 1328 | ▶ | sub set_err { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
set_err: called CC=25 SCAR=32.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 907 | 1328 | my ($h, $errnum,$msg,$state, $method, $rv) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 908 | 1328 | ▶ | $h = tied(%$h) || $h; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
tied %$h || $h
MC/DC0%0/2
tied %$h || $h
tied %$h
$h
Truth table33%1/3
A || B
A= tied %$hB= $h
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 909 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 910 | 1328 | ▶ | if (my $hss = $h->{HandleSetErr}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 911 | 38 | ▶ | return if $hss->($h, $errnum, $msg, $state, $method); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 912 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 913 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 914 | 1326 | ▶ | if (!defined $errnum) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 915 | 894 | $h->{err} = $DBI::err = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 916 | 894 | $h->{errstr} = $DBI::errstr = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 917 | 894 | $h->{state} = $DBI::state = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 918 | 894 | return; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 919 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 920 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 921 | 432 | ▶ | if ($h->{errstr}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 922 | $h->{errstr} .= sprintf " [err was %s now %s]", $h->{err}, $errnum | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 923 | 27 | ▶ | if $h->{err} && $errnum && $h->{err} ne $errnum; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
$h->{"err"} and $errnum and $h->{"err"} ne $errnum
$h->{"err"} and $errnum
MC/DC100%3/3
$h->{"err"} and $errnum and $h->{"err"} ne $errnum
$h->{"err"}
$errnum
$h->{"err"} ne $errnum
Truth table100%4/4
A and B and C
A= $h->{"err"}B= $errnumC= $h->{"err"} ne $errnum
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 924 | $h->{errstr} .= sprintf " [state was %s now %s]", $h->{state}, $state | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 925 | 27 | ▶ | if $h->{state} and $h->{state} ne "S1000" && $state && $h->{state} ne $state; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
$h->{"state"} and ($h->{"state"} ne "S1000" and $state and $h->{"state"} ne $state)
$h->{"state"} ne "S1000" and $state and $h->{"state"} ne $state
$h->{"state"} ne "S1000" and $state
MC/DC100%4/4
$h->{"state"} and ($h->{"state"} ne "S1000" and $state and $h->{"state"} ne $state)
$h->{"state"}
$h->{"state"} ne "S1000"
$state
$h->{"state"} ne $state
Truth table100%5/5
A and B and C and D
A= $h->{"state"}B= $h->{"state"} ne "S1000"C= $stateD= $h->{"state"} ne $state
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 926 | 27 | ▶ | $h->{errstr} .= "\n$msg" if $h->{errstr} ne $msg; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 927 | 27 | $DBI::errstr = $h->{errstr}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 928 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 929 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 930 | 405 | $h->{errstr} = $DBI::errstr = $msg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 931 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 932 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 933 | # assign if higher priority: err > "0" > "" > undef | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 934 | 432 | my $err_changed; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 935 | 432 | ▶ | if ($errnum # new error: so assign | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
$errnum or not defined $h->{"err"} or defined $errnum and length $errnum > length $h->{"err"}
$errnum or not defined $h->{"err"}
defined $errnum and length $errnum > length $h->{"err"}
MC/DC75%3/4
$errnum or not defined $h->{"err"} or defined $errnum and length $errnum > length $h->{"err"}
$errnum
not defined $h->{"err"}
defined $errnum
length $errnum > length $h->{"err"}
Truth table80%4/5
A or not(B) or C and D
A= $errnumB= not defined $h->{"err"}C= defined $errnumD= length $errnum > length $h->{"err"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 936 | or !defined $h->{err} # no existing warn/info: so assign | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 937 | # new warn ("0" len 1) > info ("" len 0): so assign | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 938 | or defined $errnum && length($errnum) > length($h->{err}) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 939 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 940 | 423 | $h->{err} = $DBI::err = $errnum; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 941 | 423 | ▶ | ++$h->{ErrCount} if $errnum; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 942 | 423 | ++$err_changed; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 943 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 944 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 945 | 432 | ▶ | if ($err_changed) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 946 | 423 | ▶ | $state ||= "S1000" if $DBI::err; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$state ||= "S1000"
MC/DC100%1/1
$state ||= "S1000"
$state
Truth table100%2/2
A
A= $state
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 947 | 423 | ▶ | $h->{state} = $DBI::state = ($state eq "00000") ? "" : $state | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 948 | if $state; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 949 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 950 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 951 | 432 | ▶ | if (my $p = $h->{Database}) { # just sth->dbh, not dbh->drh (see ::db::DESTROY) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 952 | 224 | $p->{err} = $DBI::err; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 953 | 224 | $p->{errstr} = $DBI::errstr; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 954 | 224 | $p->{state} = $DBI::state; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 955 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 956 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 957 | 432 | $h->{'dbi_pp_last_method'} = $method; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 958 | 432 | return $rv; # usually undef | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 959 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 960 | 4714 | ▶ | sub trace_msg { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
trace_msg: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 961 | 4714 | my ($h, $msg, $minlevel)=@_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 962 | 4714 | ▶ | $minlevel //= 1; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$minlevel //= 1
MC/DC100%1/1
$minlevel //= 1
$minlevel
Truth table100%2/2
A
A= $minlevel
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 963 | 4714 | ▶ | return unless $minlevel <= ($DBI::dbi_debug & 0xF); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 964 | 73 | print $DBI::tfh $msg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 965 | 73 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 966 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 967 | 0 | ▶ | sub private_data { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
private_data: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 968 | 0 | warn "private_data @_"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 969 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 970 | 1 | ▶ | sub take_imp_data { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
take_imp_data: called CC=8 SCAR=20.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 971 | 1 | my $dbh = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 972 | # A reasonable default implementation based on the one in DBI.xs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 973 | # Typically a pure-perl driver would have their own take_imp_data method | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 974 | # that would delete all but the essential items in the hash before ending with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 975 | # return $dbh->SUPER::take_imp_data(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 976 | # Of course it's useless if the driver doesn't also implement support for | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 977 | # the dbi_imp_data attribute to the connect() method. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 978 | 1 | require Storable; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 979 | croak("Can't take_imp_data from handle that's not Active") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 980 | 1 | ▶ | unless $dbh->{Active}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 981 | 1 | ▶ | for my $sth (@{ $dbh->{ChildHandles} || [] }) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$dbh->{'ChildHandles'} || []
MC/DC0%0/1
$dbh->{'ChildHandles'} || []
$dbh->{'ChildHandles'}
Truth table50%1/2
A
A= $dbh->{'ChildHandles'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 982 | 3 | ▶ | next unless $sth; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 983 | 2 | ▶ | $sth->finish if $sth->{Active}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 984 | 2 | bless $sth, 'DBI::zombie'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 985 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 986 | 1 | delete $dbh->{$_} for (keys %is_valid_attribute); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 987 | 1 | delete $dbh->{$_} for grep { m/^dbi_/ } keys %$dbh; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 988 | # warn "@{[ %$dbh ]}"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 989 | 1 | local $Storable::forgive_me = 1; # in case there are some CODE refs | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 990 | 1 | my $imp_data = Storable::freeze($dbh); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 991 | # XXX um, should probably untie here - need to check dispatch behaviour | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 992 | 1 | return $imp_data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 993 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 994 | 0 | ▶ | sub rows { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rows: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 995 | 0 | return -1; # always returns -1 here, see DBD::_::st::rows below | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 996 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 997 | 2060 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 998 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 999 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1000 | package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1001 | DBD::_::dr; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1002 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1003 | 4 | ▶ | sub dbixs_revision { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dbixs_revision: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1004 | 4 | return 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1005 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1006 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1007 | package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1008 | DBD::_::db; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1009 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1010 | 711 | ▶ | sub connected { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
connected: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1011 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1012 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1013 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1014 | package | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1015 | DBD::_::st; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1016 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1017 | 0 | ▶ | sub fetchrow_arrayref { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fetchrow_arrayref: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1018 | 0 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1019 | # if we're here then driver hasn't implemented fetch/fetchrow_arrayref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1020 | # so we assume they've implemented fetchrow_array and call that instead | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1021 | 0 | ▶ | my @row = $h->fetchrow_array or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1022 | 0 | return $h->_set_fbav(\@row); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1023 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1024 | # twice to avoid typo warning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1025 | 107 | *fetch = \&fetchrow_arrayref; *fetch = \&fetchrow_arrayref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1026 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1027 | 4 | ▶ | sub fetchrow_array { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fetchrow_array: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1028 | 4 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1029 | # if we're here then driver hasn't implemented fetchrow_array | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1030 | # so we assume they've implemented fetch/fetchrow_arrayref | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1031 | 4 | ▶ | my $row = $h->fetch or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1032 | 4 | return @$row; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1033 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1034 | 107 | *fetchrow = \&fetchrow_array; *fetchrow = \&fetchrow_array; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1035 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1036 | 28 | ▶ | sub fetchrow_hashref { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fetchrow_hashref: called CC=4 SCAR=14.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1037 | 28 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1038 | 28 | ▶ | my $row = $h->fetch or return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1039 | 26 | my $FetchCase = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1040 | 26 | ▶ | my $FetchHashKeyName = $FetchCase || $h->{'FetchHashKeyName'} || 'NAME'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition60%3/5
$FetchCase || $h->{'FetchHashKeyName'} || 'NAME'
$FetchCase or $h->{"FetchHashKeyName"}
MC/DC0%0/2
$FetchCase || $h->{'FetchHashKeyName'} || 'NAME'
$FetchCase
$h->{"FetchHashKeyName"}
Truth table66%2/3
A or B
A= $FetchCaseB= $h->{"FetchHashKeyName"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1041 | 26 | my $FetchHashKeys = $h->FETCH($FetchHashKeyName); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1042 | 26 | my %rowhash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1043 | 26 | @rowhash{ @$FetchHashKeys } = @$row; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1044 | 22 | return \%rowhash; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1045 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1046 | 1923 | ▶ | sub dbih_setup_fbav { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
dbih_setup_fbav: called CC=3 SCAR=11.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1047 | 1923 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1048 | 1923 | ▶ | return $h->{'_fbav'} || do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$h->{'_fbav'} || do {
$DBI::rows = $h->{'_rows'} = 0;
my $fields = $h->{'NUM_OF_FIELDS'} or DBI::croak('NUM_OF_FIELDS not set');
my(@row) = (undef) x $fields;
\@row
}
MC/DC0%0/2
$h->{'_fbav'} || do {
$DBI::rows = $h->{'_rows'} = 0;
my $fields = $h->{'NUM_OF_FIELDS'} or DBI::croak('NUM_OF_FIELDS not set');
my(@row) = (undef) x $fields;
\@row
}
$h->{'_fbav'}
do {
$DBI::rows = $h->{'_rows'} = 0;
my $fields = $h->{'NUM_OF_FIELDS'} or DBI::croak('NUM_OF_FIELDS not set');
my(@row) = (undef) x $fields;
\@row
}
Truth table66%2/3
A || B
A= $h->{'_fbav'}B= do {
$DBI::rows = $h->{'_rows'} = 0;
my $fields = $h->{'NUM_OF_FIELDS'} or DBI::croak('NUM_OF_FIELDS not set');
my(@row) = (undef) x $fields;
\@row
}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1049 | 1919 | $DBI::rows = $h->{'_rows'} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1050 | 1919 | ▶ | my $fields = $h->{'NUM_OF_FIELDS'} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1051 | or DBI::croak("NUM_OF_FIELDS not set"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1052 | 1919 | my @row = (undef) x $fields; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1053 | 1919 | \@row; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1054 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1055 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1056 | 172 | ▶ | sub _get_fbav { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_get_fbav: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1057 | 172 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1058 | 172 | ▶ | my $av = $h->{'_fbav'} ||= dbih_setup_fbav($h); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$h->{"_fbav"} ||= dbih_setup_fbav($h)
MC/DC0%0/2
$h->{"_fbav"} ||= dbih_setup_fbav($h)
$h->{"_fbav"}
dbih_setup_fbav($h)
Truth table66%2/3
A ||= B
A= $h->{"_fbav"}B= dbih_setup_fbav($h)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1059 | 172 | $DBI::rows = ++$h->{'_rows'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1060 | 172 | return $av; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1061 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1062 | 1679 | ▶ | sub _set_fbav { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_set_fbav: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1063 | 1679 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1064 | 1679 | my $fbav = $h->{'_fbav'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1065 | 1679 | ▶ | if ($fbav) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1066 | 1513 | $DBI::rows = ++$h->{'_rows'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1067 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1068 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1069 | 166 | $fbav = $h->_get_fbav; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1070 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1071 | 1679 | my $row = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1072 | 1679 | ▶ | if (my $bc = $h->{'_bound_cols'}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1073 | 182 | for my $i (0..@$row-1) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1074 | 474 | my $bound = $bc->[$i]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1075 | 474 | ▶ | $fbav->[$i] = ($bound) ? ($$bound = $row->[$i]) : $row->[$i]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1076 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1077 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1078 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1079 | 1497 | @$fbav = @$row; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1080 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1081 | 1679 | return $fbav; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1082 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1083 | 162 | ▶ | sub bind_col { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
bind_col: called CC=6 SCAR=18.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1084 | 162 | my ($h, $col, $value_ref,$from_bind_columns) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1085 | 162 | ▶ | my $fbav = $h->{'_fbav'} ||= dbih_setup_fbav($h); # from _get_fbav() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$h->{"_fbav"} ||= dbih_setup_fbav($h)
MC/DC0%0/2
$h->{"_fbav"} ||= dbih_setup_fbav($h)
$h->{"_fbav"}
dbih_setup_fbav($h)
Truth table66%2/3
A ||= B
A= $h->{"_fbav"}B= dbih_setup_fbav($h)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1086 | 162 | my $num_of_fields = @$fbav; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1087 | 162 | ▶ | DBI::croak("bind_col: column $col is not a valid column (1..$num_of_fields)") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$col < 1 or $col > $num_of_fields
MC/DC100%2/2
$col < 1 or $col > $num_of_fields
$col < 1
$col > $num_of_fields
Truth table100%3/3
A or B
A= $col < 1B= $col > $num_of_fields
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1088 | if $col < 1 or $col > $num_of_fields; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1089 | 156 | ▶ | return 1 if not defined $value_ref; # ie caller is just trying to set TYPE | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1090 | 154 | ▶ | DBI::croak("bind_col($col,$value_ref) needs a reference to a scalar") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1091 | unless ref $value_ref eq 'SCALAR'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1092 | 154 | $h->{'_bound_cols'}->[$col-1] = $value_ref; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1093 | 154 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1094 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1095 | 1252 | ▶ | sub finish { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
finish: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1096 | 1252 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1097 | 1252 | $h->{'_fbav'} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1098 | 1252 | $h->{'Active'} = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1099 | 1252 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1100 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1101 | 3 | ▶ | sub rows { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
rows: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1102 | 3 | my $h = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1103 | 3 | my $rows = $h->{'_rows'}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1104 | 3 | ▶ | return -1 unless defined $rows; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1105 | 3 | return $rows; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1106 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1107 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1108 | 107 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 1109 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||