Branch Coverage

blib/lib/DBD/PgLite.pm
Criterion Covered Total %
branch 125 228 54.8


line true false branch
36 161 1 if @_
41 0 161 if @_
42 1 160 unless defined $Transaction
46 1 7 if @_
52 5 3 if $set
56 5 2 if @_
74 0 1 if $drh
88 0 0 if $dbh
112 1 6 unless ($dbh->selectrow_array($check_tbl, {}, 'pglite_seq'))
117 2 5 unless ($dbh->selectrow_array($check_seq, {}, $sn))
125 2 2 $col ? :
4 0 if $tn =~ s/_+([a-z]*)$//l
126 1 3 if ($dbh->selectrow_array($check_tbl, {}, $tn))
132 1 1 if (int $val > 0)
151 4 1 if $rc and $rc > 0
153 1 0 if $rc and $rc > 0
155 0 0 if ++$tries > 20
169 0 3 unless $val
178 0 2 unless $val
188 0 2 unless $val
189 2 0 unless defined $called
190 2 0 $called ? :
196 2 0 if $rc and $rc > 0
198 0 0 if ++$tries > 20
211 3 1 $mode =~ /both|leading|left/il ? :
212 3 1 $mode =~ /both|trailing|right/il ? :
214 3 1 if $left
215 3 1 if $right
228 0 2 unless $txt
229 1 1 if $from eq $to
230 0 1 unless my $c = 'Text::Iconv'->new($from, $to)
231 0 1 unless $txt = $c->convert($txt)
238 0 2 if $kernel =~ /SunOS|Solaris/il
245 0 2 if length $str >= $len
246 1 1 if ($mode eq 'left') { }
263 0 1 if $encoding
271 0 8 unless $pgt =~ /-/l
274 1 7 if ($pgt =~ /^(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)\.(\d+)$/l) { }
7 0 elsif ($pgt =~ /^(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)$/l) { }
0 0 elsif ($pgt =~ /^(\d+)-(\d+)-(\d+) (\d+):(\d+)$/l) { }
0 0 elsif ($pgt =~ /^(\d+)-(\d+)-(\d+)$/l) { }
283 0 8 unless $yr
285 1 7 if ($fraction)
295 0 420 unless length $b <=> length $a
312 0 0 if $time =~ /^\d+$/l
314 0 0 if ($field eq 'second') { }
0 0 elsif ($field eq 'minute') { }
0 0 elsif ($field eq 'hour') { }
0 0 elsif ($field eq 'day') { }
0 0 elsif ($field eq 'month') { }
0 0 elsif ($field eq 'year') { }
338 8 0 $yr % 4 ? :
345 7 1 if $fraction >= 1
346 8 0 $hr > 11 ? :
347 8 0 $hr > 11 ? :
349 3 5 if ($type eq 'extract') { }
351 3 0 $yr > 100 ? :
373 0 5 $hr == 12 ? :
0 5 $hr == 12 ? :
0 5 $hr == 12 ? :
0 5 $hr == 12 ? :
431 0 1 unless $formats{$mode}
438 1 0 if ($mode eq 'timestamp') { }
0 0 elsif ($mode eq 'date') { }
0 0 elsif ($mode eq 'time') { }
440 0 1 if $with_tz
445 0 0 if $with_tz
479 0 0 if $str =~ s/(\d\d):(\d\d)//l
480 0 0 if $hr
481 0 0 if $min
482 0 0 if $str =~ s/:(\d\d)//l
484 0 0 if ($str =~ s/([\d\.]+)\s*$u//l)
1150 0 2 if @args > 9
1151 0 2 unless $sql =~ /^\s*select\b/il
1153 0 2 unless (defined $_)
1157 0 2 if /^[\-\+]?\d+(?:\.\d+)$/l
1161 1 1 if (@args and $sql =~ /\$\d/l)
1167 0 2 unless $res and @$res
1168 0 2 if @$res > 1
1170 0 2 if @$row > 1
1188 1 1 if ($check)
1191 0 1 if ($$sp{'type'} eq 'perl') { }
1193 0 0 if ($@) { }
1214 1 0 if (ref $attr)
1219 0 1 unless my $real_dbh = 'DBI'->connect("dbi:SQLite:$dsn", $user, $auth, \%attr)
1234 0 1 if $dbh and $$dbh{'D'}
1235 0 0 if $x and $$x{'D'}
1243 0 0 if $k eq 'D'
1328 0 161 if ref $$dbh{'prefilter'} eq 'CODE'
1329 1 160 if ref $$attr{'prefilter'} eq 'CODE'
1331 161 0 unless DBD::PgLite::getTransaction()
1338 0 161 if (exists $$attr{'FilterSQL'})
1339 0 0 unless $$attr{'FilterSQL'}
1341 161 0 if ($$dbh{'D'})
1342 0 161 unless $$dbh{'FilterSQL'} or $$attr{'FilterSQL'}
1350 0 105 $1 eq q[''] ? :
1402 43 118 if $sql =~ /\s+FROM\s+(.*?)(?:\sWHERE|\sON|\sUSING|\sGROUP\s+BY|\sHAVING|\sORDER\s+BY|\sLIMIT|\;|$)/ils
1403 43 118 if ($from_clause)
1409 12 59 if ($tb =~ /\s/l)
1411 0 12 unless $real and $alias
1420 14 147 if ($sql =~ /$join_re/l)
1425 13 42 if $seen{$tab}++
1427 0 42 unless $res and ref $res eq 'ARRAY'
1429 28 98 if ($col{$$row{'name'}}) { }
1438 70 28 unless $col{$c}[0] > 1
1439 2 26 if ($from_clause and $from_clause =~ /\([^\)]*\b$col{$c}[1]\b[^\)]*\)/l) { }
1454 0 161 if ref $$dbh{'postfilter'} eq 'CODE'
1455 1 160 if ref $$attr{'postfilter'} eq 'CODE'
1462 158 3 unless $sql =~ /^\s*INSERT\s+INTO\s+([\w\.]+)\s+\(([^\)]+)\)\s+VALUES\s+\(/ils
1466 0 3 unless @pk == 1
1470 2 1 if $cols{lc $pk[0]}
1474 1 0 if ($val)
1489 0 8 unless defined $val
1495 0 1 unless $$self{'count'}