Branch Coverage

blib/lib/SQL/Interp.pm
Criterion Covered Total %
branch 107 134 79.8


line true false branch
17 5 22 if ($fn eq ':all')
21 0 22 unless $export{$fn}
23 2 20 if (ref $_[0] eq 'HASH')
25 2 0 if defined $arg->{'-as'}
72 1 0 if (UNIVERSAL::isa($_[0], 'DBI::db'))
99 83 81 if (UNIVERSAL::isa($items[0], 'SQL::Interp')) { }
0 81 elsif (UNIVERSAL::isa($items[0], 'DBI::db')) { }
106 83 81 if $state
114 12 147 if ($is_var_used)
117 16 20 unless ref $val
122 0 159 if $trace_sql_enabled
137 0 2 if (ref $item) { }
142 1 1 if ($adjacent_string_cnt == 2)
162 18 428 if (ref $item eq 'SQL::Interp::Variable')
163 16 2 unless (keys %$item == 1 and defined $item->{'value'})
170 50 396 if (ref $item eq 'SQL::Interp::SQL') { }
191 205 elsif (ref $item) { }
172 4 46 if $sql ne ''
177 30 161 if ($sql =~ /\b(NOT\s+)?IN\s*$/is) { }
8 153 elsif ($sql =~ /\bARRAY\s*$/is) { }
4 149 elsif ($sql =~ /\b(?:ON\s+DUPLICATE\s+KEY\s+UPDATE|SET)\s*$/is and ref $item eq 'HASH') { }
26 123 elsif ($sql =~ /\b(REPLACE|INSERT)[\w\s]*\sINTO\s*$id_match\s*$/is) { }
33 90 elsif ($sql =~ /(?:\bFROM|JOIN)\s*$/is and not $sql =~ /DISTINCT\s+FROM\s*$/) { }
54 36 elsif (ref $item eq 'SCALAR') { }
22 14 elsif (ref $item eq 'HASH') { }
14 0 elsif (ref $item eq 'ARRAY') { }
180 2 28 if ref $item eq 'SCALAR'
183 2 28 if ref $item eq 'REF'
185 30 0 if (ref $item eq 'ARRAY') { }
186 12 18 if (@$item == 0) { }
187 2 10 $not ? :
188 0 12 unless $sql =~ s/$id_match\s+${not}IN\s*$/$dummy_expr/is
201 2 6 if ref $item eq 'SCALAR'
204 4 4 if ref $item eq 'REF'
206 8 0 if (ref $item eq 'ARRAY') { }
216 0 4 if keys %$item == 0
225 8 18 if ref $item eq 'SCALAR'
226 18 8 if (ref $item eq 'ARRAY') { }
8 0 elsif (ref $item eq 'HASH') { }
247 2 31 if (defined $next_item and ref $next_item eq '' and $next_item =~ /\s*AS\b/is) { }
256 33 0 unless $sql eq ''
258 28 2 if defined $table_alias
265 2 20 if (keys %$item == 0) { }
272 2 32 if (not defined $val) { }
8 24 elsif (ref $val eq 'ARRAY') { }
283 14 6 if keys %$item > 1
289 0 14 unless $sql eq ''
295 27 178 unless $sql =~ /(^|\s)$/ or $item =~ /^\s/
300 16 425 if ($varobj)
318 38 165 if (ref $ele) { }
321 0 38 if ref $bind2[0]
334 2 6 if (@$list == 0) { }
353 47 0 if (ref $item eq 'ARRAY') { }
354 1 46 if @$item == 0
357 28 18 if (ref $item->[0] eq 'ARRAY') { }
18 0 elsif (ref $item->[0] eq 'HASH') { }
359 2 26 if @{$item->[0];} == 0
362 4 26 unless $is_first_row
372 2 16 if keys %{$$item[0];} == 0
376 4 16 unless $is_first_row
382 24 8 if $is_first_row
390 0 42 unless $sql eq ''
408 0 0 $idx > 0 ? :
409 0 0 defined $prev ? :
428 0 29 unless ref $value
457 0 0 ref $b eq 'SQL::Interp::SQL' ? :
458 0 0 if $inverted