Branch Coverage

blib/lib/SQL/Abstract/More.pm
Criterion Covered Total %
branch 210 280 75.0


line true false branch
32 3 10 if @_ >= 2 and $_[0] eq "-extends"
35 1 12 if $parent_sqla eq "Classic"
38 3 10 if (my $already_isa = $ISA[0])
39 2 1 unless $already_isa eq $parent_sqla
70 0 5 unless my $class = ref $orig
229 1 17 &does($_[0], 'HASH') ? :
234 12 168 if exists $params{$key}
239 2 16 if ($dialect)
240 0 2 unless my $dialect_params = $sql_dialects{$dialect}
251 0 2 unless not $params{'quote_char'} or exists $params{'name_sep'}
260 18 0 unless ref $self->{'column_alias'}
261 18 0 unless ref $self->{'table_alias'}
262 17 1 unless ref $self->{'limit_offset'}
265 0 66 unless length $b <=> length $a
299 0 5 if $self->{'WITH'}
302 0 5 unless @_
308 1 4 &does($_[0], 'ARRAY') ? :
312 1 5 if $clone->{'WITH'}{'sql'}
314 6 0 if $args{'-columns'}
316 1 5 if $args{'-final_clause'}
330 77 9 unless $self->{'WITH'}
346 1 59 unless &_called_with_named_args
355 11 48 if $join_info
359 34 25 ref $args{'-columns'} ? :
364 15 68 if ($col =~ /^\s* # ignore insignificant leading spaces (.*[^|\s]) # any non-empty string, not ending with ' ' or '|' \| # followed by a literal '|' (\w+) # followed by a word (the alias)) \s* # ignore insignificant trailing spaces $/x)
377 1 58 if ($args{'-page_index'} or $args{'-page_size'})
381 1 0 if ($args{'-page_index'})
389 11 48 if $join_info
393 4 55 if $post_select
397 11 284 if ($args{-$set_op})
409 4 55 if ($args{'-group_by'})
416 3 56 if ($args{'-having'})
424 7 52 if (my $order = $args{'-order_by'})
432 5 54 if (defined $args{'-limit'})
435 1 4 $limit_sql =~ /%s/ ? :
441 3 56 exists $args{'-for'} ? :
442 3 56 if $for
448 1 58 if ($args{'-want_details'}) { }
468 1 9 if ($parent_sqla->can('_expand_insert_value')) { }
9 0 elsif ($parent_sqla->can('_insert_values')) { }
474 0 0 if (ref $v eq "ARRAY")
475 0 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v))
482 0 0 if (ref $v eq "HASH")
483 0 0 if (grep((!/^-/), keys %$v))
488 0 0 unless (defined $v)
500 9 0 unless ($parent_sqla->can("_insert_value"))
527 1 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v)) { }
582 11 1 if (&_called_with_named_args) { }
586 0 10 unless $old_API_args[0] = $args{'-into'}
588 8 2 if ($args{'-values'}) { }
2 0 elsif ($args{'-select'}) { }
601 2 0 if (my $cols = $args{'-columns'})
604 0 2 if ($SQL::Abstract::VERSION || 0) >= 2
613 3 7 if $old_API_options
627 0 11 if $fix_RT134127
630 1 10 if ($returning_into)
636 2 9 if $sql_to_add
654 1 9 if ($parent_sqla->can('_expand_update_set_values')) { }
661 0 0 unless defined $set
671 0 0 $self->{'array_datatypes'} || $self->is_bind_value_with_type($v) ? :
0 0 ref $v eq 'ARRAY' ? :
686 0 9 if ($parent_sqla->can('_update_set_values')) { }
701 0 11 unless ref $data eq "HASH"
708 5 6 if ($where)
714 3 8 if ($options->{'returning'})
720 11 0 wantarray ? :
748 1 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v)) { }
772 0 0 if @rest or not $op =~ /^\-(.+)/
801 10 1 if (&_called_with_named_args) { }
806 1 9 if $join_info
813 3 7 if $old_API_options
822 1 10 if $join_info
828 1 10 if ($returning_into)
853 4 1 if (&_called_with_named_args) { }
885 6 14 if ($arg_returning)
890 2 4 if (&does($arg_returning, 'HASH')) { }
891 0 2 unless my(@keys) = sort(keys %$arg_returning)
909 2 14 if (defined $args->{'-order_by'})
914 2 14 if (defined $args->{'-limit'})
919 2 14 if (defined $args->{'-add_sql'})
929 15 39 unless ref $order
932 42 12 if (&does($order, "ARRAY"))
937 34 35 if not $item or ref $item
938 3 32 if $item =~ s/^-// and $item = {"-desc", $item}
939 3 29 if $item =~ s/^\+//
974 1 29 if $self->{'join_assoc_right'}
978 30 0 unless ref $combined
984 0 34 unless my $table_spec = shift()
986 31 3 unless ref $join_spec
987 34 0 unless ref $table_spec
1001 2 0 if (&does($cond, 'HASH')) { }
0 0 elsif (&does($cond, 'ARRAY')) { }
0 0 elsif ($cond) { }
1004 1 3 $merged{$col} ? :
1008 0 0 $merged{'-nest'} ? :
1022 0 2 unless $sth->isa("DBI::st")
1025 2 4 if (&does($val, 'SCALAR')) { }
2 2 elsif (&does($val, 'ARRAY') and my($bind_meth, @args) = $self->is_bind_value_with_type($val)) { }
1046 6 1 if (@$val == 2 and &does($val->[0], "HASH") and grep {$val->[0]{$_};} "dbd_attrs", "sqlt_size", "sqlt_datatype", "dbic_colname")
1051 6 0 if (my $attrs = $args->{'dbd_attrs'}) { }
0 0 elsif (my $size = $args->{'sqlt_size'}) { }
1080 12 57 if (&does($table_arg, 'ARRAY') and $table_arg->[0] eq '-join') { }
1098 13 51 $alias ? :
1109 0 31 unless $join_spec
1112 0 31 unless my($op, $bracket, $cond_list) = $join_spec =~ /$self->{'join_regex'}/x
1141 34 7 if ($cmp and $right) { }
7 0 elsif ($cond =~ /^\w+$/) { }
1143 32 2 unless $left =~ /\./
1144 27 7 unless $right =~ /\./ or $right eq $placeholder
1148 6 28 $right eq $placeholder ? :
1159 6 25 if @using
1161 1 23 $bracket eq '[' ? :
24 7 if @conditions
1170 1 33 if $self->{'join_assoc_right'}
1181 8 26 if ($join_spec->{'using'}) { }
25 1 elsif ($join_spec->{'condition'}) { }
1183 1 7 if $join_spec->{'condition'}
1190 0 25 if $join_spec->{'using'}
1209 1 32 $self->{'join_assoc_right'} ? :
1227 8 23 if ($self->{'multicols_sep'})
1229 8 0 if (@cols > 1)
1230 6 2 if ($self->{'has_multicols_in_SQL'}) { }
1243 4 15 if ($max_members_IN and &does($vals, "ARRAY") and @$vals > $max_members_IN)
1251 2 2 $op =~ /^not/i ? :
1260 2 17 if &blessed($vals)
1279 0 4 unless ($n_tuples)
1280 0 0 $op =~ /\bnot\b/i ? :
1287 3 3 unless &does($val, "ARRAY")
1289 0 6 unless @$val == $n_cols
1323 0 2 unless &does($vals, "ARRAY") and @$vals
1330 1 1 if $op =~ /\bnot\b/i
1335 3 0 unless &does($val, "ARRAY")
1337 0 3 unless @$val == $n_cols
1355 1 5 if ($self->is_bind_value_with_type($v)) { }
1372 1 0 if ($self->is_bind_value_with_type($vals)) { }
1387 0 2 unless $self->{'bindtype'} ne "columns"
1403 1 16 unless $alias
1406 11 5 unless $name =~ /[()]/
1422 51 14 unless $alias
1436 0 17 unless my $method = $limit_offset_dialects{$dialect}