Branch Coverage

blib/lib/DBIx/SearchBuilder/Handle.pm
Criterion Covered Total %
branch 153 282 54.2


line true false branch
99 1 21 if ($args{'Driver'} and not $self->isa("DBIx::SearchBuilder::Handle::" . $args{'Driver'}))
100 1 0 if $self->_UpgradeHandle($args{"Driver"})
108 0 21 if defined $args{'QuoteTableNames'}
114 0 0 if $self->dbh and $self->dbh->ping and $new_dsn eq $old_dsn
117 0 21 unless my $handle = "DBI"->connect($new_dsn, $args{'User'}, $args{'Password'})
131 0 21 if $self->_RequireQuotedTables
151 0 1 if $@
182 0 21 if $args{'SID'}
183 0 21 if $args{'Host'}
184 0 21 if $args{'Port'}
185 0 21 if $args{'RequireSSL'}
213 0 0 if @_
231 0 0 if @_
249 0 1000 if (@_)
310 0 0 if @_
327 0 0 unless $dbh
337 0 0 if ($self->isa("DBIx::SearchBuilder::Handle::mysql") and $self->{'database_version'} =~ /mariadb/i and "version"->parse("v" . $version) > "version"->parse("v10.2"))
361 21 925 if (@_)
407 0 159 if $self->QuoteTableNames
430 4 0 if $columns
433 0 4 if $self->{'QuoteTableNames'}
435 4 0 if $columns
438 0 4 unless $sth
441 0 4 $rows == 0 ? :
465 0 19 if $self->{'QuoteTableNames'}
470 0 19 if ($args{'IsSQLFunction'}) { }
538 0 1 if $self->{'QuoteTableNames'}
543 0 1 unless $sth
546 0 1 $rows == 0 ? :
562 0 1 if $self->{'QuoteTableNames'}
567 0 1 unless $sth
570 0 1 $rows == 0 ? :
583 265 237 if @_
586 2 500 unless ($sth)
587 0 2 if ($DBIx::SearchBuilder::Handle::DEBUG) { }
607 0 554 if (ref $bind_values[$bind_idx] eq "HASH")
616 0 500 if ($self->LogSQLStatements)
624 0 500 if ($self->LogSQLStatements)
628 0 500 if ($@ or not $executed)
629 0 0 if ($DBIx::SearchBuilder::Handle::DEBUG) { }
668 0 0 if ($sth) { }
738 0 0 unless (defined $self->{'database_version'})
750 0 0 if $sth
759 0 0 if $args{'Short'}
807 30 13 unless ($value =~ /^$RE_CASE_INSENSITIVE_CHARS+$/o)
845 1 9 unless defined $depth
848 3 6 if $depth > 1
872 11 9 lc $args{'Action'} eq 'commit' ? :
875 9 11 if ($depth) { }
876 4 7 unless ($args{'Force'})
884 0 9 if $args{'Force'}
890 6 3 $action eq 'commit' ? :
2 7 if ($DBIx::SearchBuilder::Handle::TRANSROLLBACK{$dbh}{$action eq "commit" ? "rollback" : "commit"})
893 3 6 if $depth
897 4 2 if ($action eq 'commit') { }
901 0 2 if "DBIx::SearchBuilder::Record::Cachable"->can("FlushCache")
961 10 51 unless $dbh and $dbh->ping
963 18 33 if (@_)
965 12 6 if ($depth) { }
990 51 131 if ($per_page)
992 4 47 if ($sb->{'_bind_values'})
994 2 2 if $first
998 28 23 if ($first)
1045 4 84 if ($args{'ALIAS2'}) { }
0 84 elsif ($args{'COLLECTION2'}) { }
1051 4 0 if ($old_alias =~ /^(.*?) (\Q$args{'ALIAS2'}\E)$/) { }
1054 0 4 if $self->QuoteTableNames
1062 4 0 if ($alias) { }
1075 0 0 if ($old_alias =~ /^(.*?) ($args{'ALIAS2'})$/) { }
1078 0 0 if $self->QuoteTableNames
1087 4 0 unless exists $args{'DISTINCT'}
1090 0 4 unless ($alias)
1111 0 0 if $alias{'depends_on'} eq "main"
1127 0 88 if $self->QuoteTableNames
1130 39 49 if ($args{'TYPE'} =~ /LEFT/i) { }
1144 1 87 if ($args{'DISTINCT'} and not defined $args{'SearchBuilder'}{'joins_are_distinct'}) { }
82 5 elsif (not $args{'DISTINCT'}) { }
1168 0 0 if (ref $part) { }
1198 0 0 if ($args{'TYPE'} =~ /LEFT/i) { }
1201 0 0 if $self->QuoteTableNames
1233 0 256 $self->{'QuoteTableNames'} ? :
1255 138 414 ref $_ ? :
1266 0 256 if (my(@not_processed) = grep((!$processed{$_}), keys %$joins))
1295 48 3 if $self->MayBeNull("SearchBuilder", $args{'SearchBuilder'}, "ALIAS", $join)
1324 0 51 if grep(($_ ne "generic_restrictions"), keys %{$args{"SearchBuilder"}{"subclauses"};})
1329 0 10 if @conditions
1337 52 1 if $join->{'type'} eq "LEFT"
1338 0 1 unless $join->{'depends_on'} eq $args{'ALIAS'}
1346 41 10 unless @conditions
1352 0 3 do { $_->{'field'} =~ /^(?i:lower)\(\s*\Q$args{'ALIAS'}\.\E/ } ? :
1 3 do { rindex($_->{'value'}, "$args{'ALIAS'}.", 0) == 0 if $_->{'value'} } ? :
9 4 do { rindex($_->{'field'}, "$args{'ALIAS'}.", 0) == 0 } ? :
13 33 ref $_ ? :
1357 4 0 if $_->{'value'}
1373 0 0 if ($conditions[$i] eq '(') { }
0 0 elsif ($conditions[$i] eq ')') { }
1379 0 0 unless $count
1389 10 3 unless @conditions or @tmp
1391 6 0 do { $e eq ')' } ? :
23 6 do { $e eq '(' } ? :
6 29 do { $e eq '1' } ? :
35 3 $e ? :
1392 1 2 if ($conditions[0] eq ")")
1398 2 0 if ($aggreg eq 'OR') { }
0 0 elsif ($aggreg eq 'AND') { }
1409 5 1 if ($conditions[0] eq ")")
1415 0 1 if ($aggreg eq 'OR') { }
1 0 elsif ($aggreg eq 'AND') { }
1426 15 8 if ($conditions[1] eq ')') { }
1433 0 6 if --$parens_count < 0
1462 0 48 $QueryHint ? :
1467 17 31 if ($args{'Wrap'})
1517 0 0 $QueryHint ? :
1528 0 0 unless ($DBIx::SearchBuilder::Handle::FIELDS_IN_TABLE{$table})
1530 0 0 unless my $sth = $self->dbh->column_info(undef, "", $table, "%")
1661 0 20 if ($args{'Timezone'})
1670 18 2 if (my $template = $self->SimpleDateTimeFunctions->{$norm_type}) { }
1770 266 0 unless ($self->HasSupportForNullsOrder)
1771 0 266 if @_
1775 0 0 if (@_)
1777 0 0 if ($mode eq 'default') { }
0 0 elsif ($mode eq 'small') { }
0 0 elsif ($mode eq 'large') { }
0 0 elsif ($mode eq 'first') { }
0 0 elsif ($mode eq 'last') { }
1798 0 0 unless $self->{'nulls_order'}
1836 0 0 if ($self->dbh)
1851 0 0 if ($self->dbh)
1855 0 0 if ($quote_char)
1856 0 0 if ($name =~ /^$quote_char(.*)$quote_char$/)
1870 0 32 unless defined $string
1882 68 2474 if ($c eq $escape_char and $in)
1883 68 0 if ($escape_char eq q[']) { }
1884 18 50 if (($chars[0] || '') eq "'")
1895 660 1882 if ($in) { }
1896 68 592 if ($c eq "'")
1897 50 18 unless ($escaped)
1909 50 1832 if ($c eq q[']) { }
0 1832 elsif (lc $c eq 'e' and ($chars[0] // '') eq q[']) { }
0 1832 elsif ($c =~ /[\d.]/ and not $placeholder =~ /\w$/) { }
1947 0 22 if $self->{'DisconnectHandleOnDestroy'}