Branch Coverage

blib/lib/SQL/Abstract/More.pm
Criterion Covered Total %
branch 198 280 70.7


line true false branch
33 3 10 if @_ >= 2 and $_[0] eq "-extends"
36 1 12 if $parent_sqla eq "Classic"
39 3 10 if (my $already_isa = $ISA[0])
40 1 2 unless $already_isa eq $parent_sqla
71 0 5 unless my $class = ref $orig
230 1 17 &does($_[0], 'HASH') ? :
235 12 168 if exists $params{$key}
240 2 16 if ($dialect)
241 0 2 unless my $dialect_params = $sql_dialects{$dialect}
252 0 2 unless not $params{'quote_char'} or exists $params{'name_sep'}
261 18 0 unless ref $self->{'column_alias'}
262 18 0 unless ref $self->{'table_alias'}
263 17 1 unless ref $self->{'limit_offset'}
266 0 64 unless length $b <=> length $a
300 0 5 if $self->{'WITH'}
303 0 5 unless @_
309 1 4 &does($_[0], 'ARRAY') ? :
313 1 5 if $clone->{'WITH'}{'sql'}
315 6 0 if $args{'-columns'}
317 1 5 if $args{'-final_clause'}
331 77 9 unless $self->{'WITH'}
347 1 59 unless &_called_with_named_args
356 11 48 if $join_info
360 34 25 ref $args{'-columns'} ? :
365 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)
378 1 58 if ($args{'-page_index'} or $args{'-page_size'})
382 1 0 if ($args{'-page_index'})
390 11 48 if $join_info
394 4 55 if $post_select
398 11 284 if ($args{-$set_op})
410 4 55 if ($args{'-group_by'})
417 3 56 if ($args{'-having'})
425 7 52 if (my $order = $args{'-order_by'})
433 5 54 if (defined $args{'-limit'})
436 1 4 $limit_sql =~ /%s/ ? :
442 3 56 exists $args{'-for'} ? :
443 3 56 if $for
449 1 58 if ($args{'-want_details'}) { }
469 10 0 if ($parent_sqla->can('_expand_insert_value')) { }
0 0 elsif ($parent_sqla->can('_insert_values')) { }
475 1 16 if (ref $v eq "ARRAY")
476 1 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v))
483 0 16 if (ref $v eq "HASH")
484 0 0 if (grep((!/^-/), keys %$v))
489 0 16 unless (defined $v)
501 0 0 unless ($parent_sqla->can("_insert_value"))
528 0 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v)) { }
583 11 1 if (&_called_with_named_args) { }
587 0 10 unless $old_API_args[0] = $args{'-into'}
589 8 2 if ($args{'-values'}) { }
2 0 elsif ($args{'-select'}) { }
602 2 0 if (my $cols = $args{'-columns'})
605 2 0 if ($SQL::Abstract::VERSION || 0) >= 2
614 3 7 if $old_API_options
628 2 9 if $fix_RT134127
631 1 10 if ($returning_into)
637 2 9 if $sql_to_add
655 10 0 if ($parent_sqla->can('_expand_update_set_values')) { }
662 0 16 unless defined $set
672 1 0 $self->{'array_datatypes'} || $self->is_bind_value_with_type($v) ? :
1 15 ref $v eq 'ARRAY' ? :
687 0 0 if ($parent_sqla->can('_update_set_values')) { }
702 0 0 unless ref $data eq "HASH"
709 0 0 if ($where)
715 0 0 if ($options->{'returning'})
721 0 0 wantarray ? :
749 0 0 if ($self->{'array_datatypes'} or $self->is_bind_value_with_type($v)) { }
773 0 0 if @rest or not $op =~ /^\-(.+)/
802 10 1 if (&_called_with_named_args) { }
807 1 9 if $join_info
814 3 7 if $old_API_options
823 1 10 if $join_info
829 1 10 if ($returning_into)
854 4 1 if (&_called_with_named_args) { }
886 6 14 if ($arg_returning)
891 2 4 if (&does($arg_returning, 'HASH')) { }
892 0 2 unless my(@keys) = sort(keys %$arg_returning)
910 2 14 if (defined $args->{'-order_by'})
915 2 14 if (defined $args->{'-limit'})
920 2 14 if (defined $args->{'-add_sql'})
930 15 39 unless ref $order
933 42 12 if (&does($order, "ARRAY"))
938 34 35 if not $item or ref $item
939 3 32 if $item =~ s/^-// and $item = {"-desc", $item}
940 3 29 if $item =~ s/^\+//
975 1 29 if $self->{'join_assoc_right'}
979 30 0 unless ref $combined
985 0 34 unless my $table_spec = shift()
987 31 3 unless ref $join_spec
988 34 0 unless ref $table_spec
1002 2 0 if (&does($cond, 'HASH')) { }
0 0 elsif (&does($cond, 'ARRAY')) { }
0 0 elsif ($cond) { }
1005 1 3 $merged{$col} ? :
1009 0 0 $merged{'-nest'} ? :
1023 0 0 unless $sth->isa("DBI::st")
1026 0 0 if (&does($val, 'SCALAR')) { }
0 0 elsif (&does($val, 'ARRAY') and my($bind_meth, @args) = $self->is_bind_value_with_type($val)) { }
1047 4 3 if (@$val == 2 and &does($val->[0], "HASH") and grep {$val->[0]{$_};} "dbd_attrs", "sqlt_size", "sqlt_datatype", "dbic_colname")
1052 4 0 if (my $attrs = $args->{'dbd_attrs'}) { }
0 0 elsif (my $size = $args->{'sqlt_size'}) { }
1081 12 57 if (&does($table_arg, 'ARRAY') and $table_arg->[0] eq '-join') { }
1099 13 51 $alias ? :
1110 0 31 unless $join_spec
1113 0 31 unless my($op, $bracket, $cond_list) = $join_spec =~ /$self->{'join_regex'}/x
1142 34 7 if ($cmp and $right) { }
7 0 elsif ($cond =~ /^\w+$/) { }
1144 32 2 unless $left =~ /\./
1145 27 7 unless $right =~ /\./ or $right eq $placeholder
1149 6 28 $right eq $placeholder ? :
1160 6 25 if @using
1162 1 23 $bracket eq '[' ? :
24 7 if @conditions
1171 1 33 if $self->{'join_assoc_right'}
1182 8 26 if ($join_spec->{'using'}) { }
25 1 elsif ($join_spec->{'condition'}) { }
1184 1 7 if $join_spec->{'condition'}
1191 0 25 if $join_spec->{'using'}
1210 1 32 $self->{'join_assoc_right'} ? :
1228 8 23 if ($self->{'multicols_sep'})
1230 8 0 if (@cols > 1)
1231 6 2 if ($self->{'has_multicols_in_SQL'}) { }
1244 4 15 if ($max_members_IN and &does($vals, "ARRAY") and @$vals > $max_members_IN)
1252 2 2 $op =~ /^not/i ? :
1261 2 17 if &blessed($vals)
1280 0 4 unless ($n_tuples)
1281 0 0 $op =~ /\bnot\b/i ? :
1288 3 3 unless &does($val, "ARRAY")
1290 0 6 unless @$val == $n_cols
1324 0 2 unless &does($vals, "ARRAY") and @$vals
1331 1 1 if $op =~ /\bnot\b/i
1336 3 0 unless &does($val, "ARRAY")
1338 0 3 unless @$val == $n_cols
1356 0 0 if ($self->is_bind_value_with_type($v)) { }
1373 0 0 if ($self->is_bind_value_with_type($vals)) { }
1388 0 0 unless $self->{'bindtype'} ne "columns"
1404 1 16 unless $alias
1407 11 5 unless $name =~ /[()]/
1423 51 14 unless $alias
1437 0 17 unless my $method = $limit_offset_dialects{$dialect}