Branch Coverage

blib/lib/SQLite_File.pm
Criterion Covered Total %
branch 251 402 62.4


line true false branch
163 0 6 unless (eval 'require DBD::SQLite; 1')
236 11 238 unless defined $self->{'SEQIDX'}
252 0 11 if (CORE::ref($mode) =~ /INFO$/)
259 0 11 unless (defined $index and CORE::ref($index) =~ /INFO$/)
268 8 3 if ($file) { }
272 1 7 if ($_ eq 'O_SVWST')
275 6 2 if ($_ & 64)
276 4 2 unless -e $file
277 2 4 -e $file ? :
279 8 0 if ($_ & 2)
280 6 2 $infix ? :
282 1 7 if ($_ & 512)
286 0 8 unless $infix
289 0 8 unless open $fh, $infix, $file
290 4 4 if $setmode
293 3 5 unless defined $keep
300 3 0 unless defined $keep
331 0 11 unless (defined $_)
335 4 7 if ($_ eq 'BINARY')
337 2 2 if (CORE::ref $index->{'compare'} eq 'CODE')
341 3 1 if ($flags & R_DUP()) { }
353 7 0 if ($_ eq 'HASH')
358 0 0 if ($_ eq 'RECNO')
366 0 8 if $infix and $infix =~ /{'type'} eq 'BINARY'
384 0 3 if (CORE::ref($mode) =~ /INFO$/)
390 0 3 unless (defined $index and CORE::ref($index) =~ /INFO$/)
394 0 3 unless $index->{'type'} eq 'RECNO'
399 1 2 if ($file) { }
402 0 1 if ($_ eq 'O_SVWST')
405 1 0 if ($_ & 64)
406 0 1 unless -e $file
407 1 0 -e $file ? :
409 1 0 if ($_ & 2)
410 1 0 $infix ? :
412 0 1 if ($_ & 512)
416 0 1 unless $infix
419 0 1 unless open $fh, $infix, $file
420 0 1 if $setmode
423 1 0 unless defined $keep
430 2 0 unless defined $keep
453 0 3 if ($_ eq 'BINARY')
458 0 3 if ($_ eq 'HASH')
463 3 0 if ($_ eq 'RECNO')
486 0 60 unless $self->dbh
488 35 25 if (not $self->{'ref'} or $self->ref eq 'HASH') { }
25 0 elsif ($self->ref eq 'ARRAY') { }
494 24 1 if (defined do { $self->SEQIDX }->[$key]) { }
506 56 3 if ($ret) { }
524 0 49 unless $self->dbh
540 36 13 if (not defined $self->{'ref'} or $self->ref eq 'HASH') { }
13 0 elsif ($self->ref eq 'ARRAY') { }
541 17 19 if ($self->dup) { }
552 1 18 if ($self->EXISTS($key)) { }
574 12 1 if (not defined do { $self->SEQIDX }->[$key]) { }
588 0 3 unless $self->dbh
595 0 3 if $self->index->{'type'} eq 'BINARY' and $self->_index_is_stale
597 2 1 if (not $self->ref or $self->ref eq 'HASH') { }
1 0 elsif ($self->ref eq 'ARRAY') { }
598 0 2 unless $self->get_sth->execute($fkey)
603 2 0 if ($ret->[1])
609 1 0 if ($SEQIDX->[$key])
628 0 25 unless $self->dbh
631 25 0 if (not $self->ref or $self->ref eq 'HASH') { }
0 0 elsif ($self->ref eq 'ARRAY') { }
636 6 19 defined $ret ? :
648 0 2 unless $self->dbh
661 0 6 unless $self->dbh
663 0 6 if $self->{'ref'} and $self->ref ne 'HASH'
665 0 6 unless $ids
676 0 27 unless $self->dbh
677 0 27 if $self->{'ref'} and $self->ref ne 'HASH'
685 0 25 unless $self->dbh
686 0 25 if not $self->{'ref'} or $self->ref ne 'ARRAY'
693 0 0 unless $self->dbh
694 0 0 if not $self->ref or $self->ref ne 'ARRAY'
695 0 0 if ($count > $self->len) { }
0 0 elsif ($count < $self->len) { }
716 0 3 unless $self->dbh
718 0 3 if not $self->{'ref'} or $self->ref ne 'ARRAY'
725 3 0 defined $ret ? :
731 0 2 unless $self->dbh
732 0 2 if not $self->{'ref'} or $self->ref ne 'ARRAY'
745 0 3 unless $self->dbh
747 0 3 if not $self->{'ref'} or $self->ref ne 'ARRAY'
761 0 2 if not $self->{'ref'} or $self->ref ne 'ARRAY'
764 0 2 unless $self->dbh
799 0 8 if $count
807 40 105 if $$self{$_ . '_sth'}
811 0 14 unless $self->dbh->disconnect
815 14 0 if $self->_fh
816 13 1 if (-e $self->file)
818 7 6 if not $self->keep and $self->_fh
819 0 13 if $!
831 0 4 unless (not defined $code or CORE::ref $code eq 'CODE')
841 0 2 unless (not defined $code or CORE::ref $code eq 'CODE')
851 1 2 unless (not defined $code or CORE::ref $code eq 'CODE')
860 0 2 unless (not defined $code or CORE::ref $code eq 'CODE')
870 2 27 if (@_)
874 21 6 unless defined $self->{'_fetch_key_filter'}
880 2 64 if (@_)
884 57 7 unless defined $self->{'_fetch_value_filter'}
890 4 112 if (@_)
894 97 15 unless defined $self->{'_store_key_filter'}
900 2 52 if (@_)
904 45 7 unless defined $self->{'_store_value_filter'}
924 14 36 if @_
942 14 35 if @_
959 15 13 if @_
1009 6 27 if ($load)
1033 0 2 unless $self->dbh
1034 1 1 $self->ref eq 'ARRAY' ? :
1035 2 0 if defined $_[1]
1055 0 8 unless $self->dbh
1062 5 3 if (not defined $_ or $_ == R_SETCURSOR())
1063 0 5 if ($self->dup) { }
1068 0 0 if $flags
1069 0 0 if $self->index->{'type'} eq 'BINARY'
1075 2 3 $self->_last_pk ? :
1079 3 2 unless $self->_last_pk
1080 2 3 if ($flags)
1081 2 0 if ($pk = $SEQIDX->[-1]) { }
1087 1 1 if $self->index->{'type'} eq 'BINARY'
1093 1 2 if ($_ == R_IAFTER())
1094 0 1 unless $$SEQIDX[$$CURSOR]
1096 0 0 unless $self->ref eq 'ARRAY' or $self->dup or not $self->EXISTS($key)
1098 0 1 unless $self->index->{'type'} eq 'RECNO'
1103 1 0 if ($$CURSOR == $#$SEQIDX) { }
1112 1 1 if ($_ == R_IBEFORE())
1113 1 0 unless $$SEQIDX[$$CURSOR]
1115 0 0 unless $self->ref eq 'ARRAY' or $self->dup or not $self->EXISTS($key)
1117 0 1 unless $self->index->{'type'} eq 'RECNO'
1122 0 1 if ($$CURSOR) { }
1132 0 1 if ($_ == R_CURSOR())
1133 0 0 unless $$SEQIDX[$$CURSOR]
1135 0 0 unless $self->ref eq 'ARRAY' or $self->dup or not $self->EXISTS($key)
1139 0 0 if $self->index->{'type'} eq 'BINARY'
1143 1 0 if ($_ == R_NOOVERWRITE())
1145 1 0 unless $self->ref eq 'ARRAY' or $self->dup or not $self->EXISTS($key)
1150 0 0 if $self->index->{'type'} eq 'BINARY'
1155 4 3 if ($self->ref eq 'ARRAY') { }
1165 7 0 unless $status
1167 3 4 if $self->index->{'type'} eq 'BINARY'
1184 0 2 unless $self->dbh
1185 0 2 if $self->index->{'type'} eq 'BINARY' and $self->_index_is_stale
1189 2 0 if ($flags eq R_CURSOR()) { }
1190 0 2 unless $$SEQIDX[$$CURSOR]
1193 2 0 if ($status)
1206 2 0 if $status
1229 0 34 unless $flags
1232 3 31 if $self->index->{'type'} eq 'BINARY' and $self->_index_is_stale
1236 6 28 if ($_ eq R_CURSOR())
1239 6 22 if ($_ eq R_FIRST())
1243 4 18 if ($_ eq R_LAST())
1247 14 4 if ($_ eq R_NEXT())
1248 3 11 if $$CURSOR >= $#$SEQIDX
1252 4 0 if ($_ eq R_PREV())
1253 2 2 if $$CURSOR == 0
1258 2 27 unless defined $$SEQIDX[$$CURSOR]
1260 3 26 if ($flags == R_CURSOR() and $self->ref eq 'HASH') { }
1268 12 14 $self->ref eq 'ARRAY' ? :
1300 4 46 if @_
1319 0 3 unless $self->dbh
1321 0 3 unless ($self->dup)
1327 1 2 unless wantarray
1329 1 1 if (not $want_hash) { }
1354 0 1 unless $self->dbh
1356 0 1 unless ($self->dup)
1364 0 1 unless $ret
1383 0 0 unless $self->dbh
1384 0 0 unless ($self->dup)
1392 0 0 unless ($ret)
1397 0 0 if ($self->del_dup_sth->execute) { }
1429 0 3 unless ($self->ref ne 'ARRAY')
1435 3 0 unless ($status)
1436 3 0 if ($ret = $self->{'part_seq_sth'}->fetch)
1439 0 3 unless (defined($$CURSOR = _find_idx($pk, $SEQIDX)))
1463 14 714 if @_
1482 0 349 unless $self->dbh
1484 0 349 unless ($tbl)
1487 40 309 unless ($$self{"${desc}_sth"})
1488 0 40 unless grep /^$desc$/, keys %$tbl
1501 0 349 unless ($desc =~ /^(.*?)_sth$/)
1505 349 0 if (defined $desc) { }
1506 0 349 unless (grep /^$desc$/, keys %{$STMT{$self->ref};})
1531 14 135 if (@_ or $self->{'pending'} > $SQLite_File::MAXPEND)
1532 0 14 unless $self->dbh->commit
1565 0 0 unless $self->dbh
1604 0 0 unless $self->index->{'type'} eq 'BINARY'
1607 0 0 unless ($q)
1631 0 4 unless $self->index->{'type'} eq 'BINARY'
1637 0 4 unless ($q)
1641 4 0 if (defined $$CURSOR) { }
1668 0 39 unless defined $seqidx->[$_]
1669 10 29 if $pk == $seqidx->[$_]
1689 2 8 unless defined $$CURSOR
1693 62 4 if (defined $SEQIDX->[$i]) { }
1694 10 52 if $$CURSOR == $i
1698 4 0 if $$CURSOR == $i
1735 85 16 if @_
1751 39 16 if defined $SEQIDX->[$index]
1774 0 4 unless (delete do { $self->SEQIDX }->[$index])