Branch Coverage

blib/lib/SQL/Abstract/More.pm
Criterion Covered Total %
branch 227 316 71.8


line true false branch
32 3 11 if @_ >= 2 and $_[0] eq "-extends"
35 3 11 if $parent_sqla
43 1 13 if $parent_sqla eq "Classic"
46 3 11 if (my $already_isa = $ISA[0])
47 2 1 unless $already_isa eq $parent_sqla
78 0 6 unless my $class = ref $orig
243 1 27 unless @ISA
246 0 28 &does($_[0], 'HASH') ? :
251 22 258 if exists $params{$key}
256 6 22 if ($dialect)
257 0 6 unless my $dialect_params = $sql_dialects{$dialect}
268 0 9 unless not $params{'quote_char'} or exists $params{'name_sep'}
277 28 0 unless ref $self->{'column_alias'}
278 28 0 unless ref $self->{'table_alias'}
279 26 2 unless ref $self->{'limit_offset'}
282 0 111 unless length $b <=> length $a
307 0 6 if $self->{'WITH'}
310 0 6 unless @_
316 1 5 &does($_[0], 'ARRAY') ? :
321 0 0 $args{'-columns'} ? :
7 0 &does($args{'-columns'}, 'ARRAY') ? :
323 1 6 if $clone->{'WITH'}{'sql'}
325 7 0 if @cols
327 1 6 if $args{'-final_clause'}
349 183 10 unless $self->{'WITH'}
364 4 136 unless &_called_with_named_args
381 136 0 ref $cols ? :
387 8 128 if $all_post_select
391 16 664 if (my $val_set_op = $args{-$set_op})
398 8 128 if ($args{'-group_by'})
405 5 131 if ($args{'-having'})
412 15 121 if (my $order = $args{'-order_by'})
417 2 134 if $args{'-page_index'} or $args{'-page_size'}
418 10 126 if (defined $args{'-limit'})
420 2 8 if ($limit_sql =~ /%s/) { }
430 6 130 exists $args{'-for'} ? :
431 6 130 if $for
434 8 128 if (my $alias = $args{'-as'})
443 2 134 $args{'-want_details'} ? :
454 80 56 ref $columns ? :
466 6 199 if (_is_subquery($col))
474 60 145 if $alias
478 179 26 unless $col =~ /[(),]/
481 60 145 if $alias
509 2 0 if ($args->{'-page_index'})
525 1 10 if ($parent_sqla->can('_expand_insert_value')) { }
10 0 elsif ($parent_sqla->can('_insert_values')) { }
531 0 0 if (ref $v eq "ARRAY")
532 0 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v))
539 0 0 if (ref $v eq "HASH")
540 0 0 if (grep((!/^-/), keys %$v))
545 0 0 unless (defined $v)
566 10 0 unless ($parent_sqla->can("_insert_value"))
593 2 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v)) { }
649 2 23 if (not &_called_with_named_args) { }
656 0 21 unless $args{'-into'}
662 18 3 if (my $values = $args{'-values'}) { }
3 0 elsif ($args{'-select'}) { }
663 0 18 if $args{'-select'}
665 14 4 if (&does($values, 'HASH')) { }
4 0 elsif (&does($values, 'ARRAY')) { }
666 0 14 if $args{'-columns'}
671 2 2 if (my $cols = $args{'-columns'}) { }
672 0 2 unless ref $cols
673 0 2 unless @$cols == @$values
702 3 0 if (my $cols = $args{'-columns'})
703 0 3 unless ref $cols
718 6 15 if ($args{'-returning'})
724 2 4 if ($into)
731 4 17 if $args{'-add_sql'}
750 1 10 if ($parent_sqla->can('_expand_update_set_values')) { }
757 0 0 unless defined $set
767 0 0 $self->{'array_datatypes'} || $self->is_bind_value_with_type($v) ? :
0 0 if (ref $v eq 'ARRAY') { }
782 0 10 if ($parent_sqla->can('_update_set_values')) { }
797 0 0 unless ref $data eq "HASH"
804 0 0 if ($where)
810 0 0 if ($options->{'returning'})
816 0 0 wantarray ? :
844 2 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v)) { }
868 0 0 if @rest or not $op =~ /^\-(.+)/
895 2 21 if (not &_called_with_named_args) { }
902 0 21 unless &does($args{'-set'}, "HASH")
908 2 19 defined $join_info ? :
912 9 12 if ($args{'-where'})
920 6 15 if $returning
923 2 19 if $join_info
929 2 19 if ($into)
956 2 9 if (not &_called_with_named_args) { }
985 12 15 if ($arg_returning)
989 4 8 if (&does($arg_returning, 'HASH')) { }
990 0 4 unless my(@keys) = sort(keys %$arg_returning)
1008 4 26 if (defined $args->{'-order_by'})
1013 4 26 if (defined $args->{'-limit'})
1018 4 26 if (defined $args->{'-add_sql'})
1028 22 49 unless ref $order
1031 59 12 if (&does($order, "ARRAY"))
1036 34 55 if not $item or ref $item
1037 4 51 if $item =~ s/^-// and $item = {"-desc", $item}
1038 4 47 if $item =~ s/^\+//
1070 2 45 if $self->{'join_assoc_right'}
1080 0 54 unless my $next_source = shift()
1082 49 5 unless ref $join_spec
1097 4 0 if (&does($cond, 'HASH')) { }
0 0 elsif (&does($cond, 'ARRAY')) { }
0 0 elsif ($cond) { }
1100 2 6 $merged{$col} ? :
1104 0 0 $merged{'-nest'} ? :
1118 0 0 unless $sth->isa("DBI::st")
1121 0 0 if (&does($val, 'SCALAR')) { }
0 0 elsif (&does($val, 'ARRAY') and my($bind_meth, @args) = $self->is_bind_value_with_type($val)) { }
1142 8 2 if (@$val == 2 and &does($val->[0], "HASH") and grep {$val->[0]{$_};} "dbd_attrs", "sqlt_size", "sqlt_datatype", "dbic_colname")
1147 8 0 if (my $attrs = $args->{'dbd_attrs'}) { }
0 0 elsif (my $size = $args->{'sqlt_size'}) { }
1175 22 257 if (&does($table_arg, 'ARRAY') and $table_arg->[0] eq '-join') { }
1187 103 372 $input_sql =~ /^\s* # ignore insignificant leading spaces (\S.*?) # $1: any non-empty string, no starting with space (but may include '|') (?
1204 20 238 if (my $join_info = $self->_compute_join_info($source)) { }
8 230 elsif (_is_subquery($source)) { }
4 226 elsif (&does($source, 'ARRAY')) { }
2 224 elsif (&does($source, 'SCALAR')) { }
1238 43 227 $alias ? :
1244 260 10 unless $dont_quote_table
1246 43 227 $alias ? :
1255 0 49 unless $join_spec
1258 0 49 unless my($op, $bracket, $cond_list) = $join_spec =~ /$self->{'join_regex'}/x
1287 56 8 if ($cmp and $right) { }
8 0 elsif ($cond =~ /^\w+$/) { }
1289 52 4 unless $left =~ /\./
1290 46 10 unless $right =~ /\./ or $right eq $placeholder
1294 8 48 $right eq $placeholder ? :
1305 7 42 if @using
1307 2 38 $bracket eq '[' ? :
40 9 if @conditions
1316 2 52 if $self->{'join_assoc_right'}
1327 11 43 if ($join_spec->{'using'}) { }
41 2 elsif ($join_spec->{'condition'}) { }
1329 1 10 if $join_spec->{'condition'}
1336 0 41 if $join_spec->{'using'}
1355 2 51 $self->{'join_assoc_right'} ? :
1373 8 46 if ($self->{'multicols_sep'})
1375 8 0 if (@cols > 1)
1376 6 2 if ($self->{'has_multicols_in_SQL'}) { }
1389 8 32 if ($max_members_IN and &does($vals, "ARRAY") and @$vals > $max_members_IN)
1397 4 4 $op =~ /^not/i ? :
1406 4 34 if builtin::blessed($vals)
1425 0 4 unless ($n_tuples)
1426 0 0 $op =~ /\bnot\b/i ? :
1433 3 3 unless &does($val, "ARRAY")
1435 0 6 unless @$val == $n_cols
1469 0 2 unless &does($vals, "ARRAY") and @$vals
1476 1 1 if $op =~ /\bnot\b/i
1481 3 0 unless &does($val, "ARRAY")
1483 0 3 unless @$val == $n_cols
1501 2 10 if ($self->is_bind_value_with_type($v)) { }
1518 2 0 if ($self->is_bind_value_with_type($vals)) { }
1533 0 4 unless $self->{'bindtype'} ne "columns"
1549 107 2 $alias ? :
1556 0 26 unless my $method = $limit_offset_dialects{$dialect}