Branch Coverage

lib/DBIx/Struct.pm
Criterion Covered Total %
branch 186 682 27.2


line true false branch
12 0 0 if $dbh
13 0 0 if $try != $db_reconnect_timeout
15 0 0 if $@
135 0 0 if 'HASH' ne ref $hashref
148 1 0 unless $er
157 1 0 if ($args[$i] eq 'connector_module') { }
0 0 elsif ($args[$i] eq 'connector_constructor') { }
0 0 elsif ($args[$i] eq 'table_classes_namespace') { }
0 0 elsif ($args[$i] eq 'query_classes_namespace') { }
0 0 elsif ($args[$i] eq 'connect_timeout') { }
0 0 elsif ($args[$i] eq 'error_class') { }
0 0 elsif ($args[$i] eq 'connector_args') { }
0 0 elsif ($args[$i] eq 'connector_object') { }
160 0 1 if (not $defconn and check_package_scalar($connector_module, 'conn'))
178 0 0 unless $init_import
190 1 0 unless ($init_import)
204 1 0 unless ($conn)
206 0 1 if ($dsn and not $dsn =~ /^dbi:/i)
215 0 1 if ($dsn)
217 0 0 if ($driver)
218 0 0 if ($driver eq 'Pg') { }
0 0 elsif ($driver eq 'mysql') { }
225 1 0 unless (@$connector_args)
228 0 1 unless $conn = $connector_module->$connector_constructor(@$connector_args)
254 30 3 if ($simple_table) { }
270 0 1 unless $sth
273 3 0 if $_->[3] eq 'TABLE'
292 3 3 unless (ref $table)
335 0 3 if ($required)
444 3 3 if (not ref $table) { }
549 3 3 if (not ref $table) { }
591 3 3 if (not ref $table) { }
635 26 6 if (grep {not /::$/;} keys %{"${ncn}::";})
644 0 0 unless ref $interface
645 0 0 if ('ARRAY' eq ref $interface) { }
0 0 elsif ('HASH' eq ref $interface) { }
648 0 0 unless &_exists_row($dbc_name)
655 0 0 if ($href and %$href)
663 0 0 unless &_exists_row($dbc_name)
670 0 0 unless $href and %$href
672 0 0 unless ref $fl
673 0 0 if ('ARRAY' eq ref $fl) { }
675 0 0 if exists $href->{$m}
700 0 29 unless exists $driver_pk_insert{$connector_driver}
702 23 6 if &_exists_row($ncn)
710 3 3 if (not ref $table) { }
715 0 3 unless $cih
724 0 6 if ($chr->{'TYPE_NAME'} =~ /^time/)
727 0 6 if ($chr->{'NULLABLE'} == 0 and not defined $chr->{'COLUMN_DEF'})
733 0 3 if (not @pkeys and @required)
738 0 0 if (not exists $req{$ukr->{'COLUMN_NAME'}} or defined $ukr->{'FILTER_CONDITION'}) { }
746 0 0 if (%pkeys)
753 3 0 if ($sth)
758 3 0 if ($sth)
772 0 6 if $ti and $ti->{'TYPE_NAME'} =~ /^time/
779 0 6 if (@required)
783 0 6 if (@timestamp_fields) { }
803 2 4 if (@pkeys) { }
815 1 3 if (@fields) { }
834 0 2 unless $fn =~ s/^id_//
866 2 0 if ($pk ne $fk)
868 0 2 unless $fn =~ s/^id_//
870 2 0 if $fn
908 0 12 if exists $keywords{$k}
909 0 12 if $k =~ /^\d/
911 4 8 if (not exists $pk_fields{$k} || ref $table) { }
938 3 3 unless (ref $table)
939 3 0 if (%fkfuncs) { }
961 3 3 if (not ref $table) { }
976 6 0 if $DBIx::Struct::update_on_destroy
3 0 if $DBIx::Struct::update_on_destroy
3 0 if $DBIx::Struct::update_on_destroy
0 0 if (defined $_[0]->id_list) { }
2 0 if (defined $_[0]->id_prim) { }
0 0 unless $_->do('delete from pl_assoc where ', undef)
0 0 unless my $rowref = $_->selectrow_arrayref("select * from prim $where", undef, @bind)
0 0 unless $_->do('delete from prim where id = ?', undef, $self->[0][0])
0 0 unless $_->do('delete from list where id = ?', undef, $self->[0][0])
0 0 unless $_->do("delete from pl_assoc $where", undef, @bind)
0 0 unless my $rowref = $_->selectrow_arrayref('select * from prim where id = ?', undef, $self->[0][0])
0 0 unless $_->do("update pl_assoc set $set $where", undef, @bind, @bind_where)
0 0 unless my $rowref = $_->selectrow_arrayref("select * from list $where", undef, @bind)
0 0 unless my $rowref = $_->selectrow_arrayref('select * from list where id = ?', undef, $self->[0][0])
0 0 unless $_->do($insert, undef, @bind)
0 1 unless $_->do("update list set $set $where", undef, @bind, @bind_where)
0 3 unless ($self->[0][0]) = $_->selectrow_array($insert . ' returning id', undef, @bind)
0 0 unless $_->do("update prim set $set $where", undef, @bind, @bind_where)
0 0 unless $_->do($update_query, undef, @bind)
0 0 unless my $rowref = $_->selectrow_arrayref("select * from pl_assoc $where", undef, @bind)
0 1 unless $_->do("delete from list $where", undef, @bind)
0 0 unless ($self->[0][0]) = $_->selectrow_array($insert . ' returning id', undef, @bind)
0 3 unless $_->do($update_query, undef, @bind, $self->[0][0])
0 0 unless my $rowref = $_->selectrow_arrayref('select * from pl_assoc where ', undef)
0 0 unless $_->do("delete from prim $where", undef, @bind)
0 0 unless $_->do($update_query, undef, @bind, $self->[0][0])
0 0 if (not @{$_[1];}) { }
0 0 if exists $fields{$k}
0 0 if (CORE::ref $_[1] eq 'ARRAY') { }
0 0 if (defined $_[1]) { }
0 0 unless defined $ret
0 0 if (not @{$_[1];}) { }
0 0 if exists $fields{$k}
0 0 if (ref $_[1] eq 'ARRAY') { }
0 0 if (defined $_[1]) { }
0 0 unless defined $ret
0 0 if (not @{$_[1];}) { }
0 0 if exists $fields{$k}
0 0 if (ref $_[1] eq 'ARRAY') { }
0 0 if (defined $_[1]) { }
0 0 unless defined $ret
0 0 if (not @{$_[1];}) { }
0 0 if exists $fields{$k}
0 0 if (CORE::ref $_[1] eq 'ARRAY') { }
0 0 if (defined $_[1]) { }
0 0 unless defined $ret
0 0 if (not @{$_[1];}) { }
0 0 if exists $fields{$k}
0 0 if (CORE::ref $_[1] eq 'ARRAY') { }
0 0 if (defined $_[1]) { }
0 0 unless defined $ret
0 0 if (not @{$_[1];}) { }
0 0 if exists $fields{$k}
0 0 if (CORE::ref $_[1] eq 'ARRAY') { }
0 0 if (defined $_[1]) { }
0 0 unless defined $ret
0 1 unless (CORE::ref $cond)
1 0 if (@_ > 1) { }
0 0 unless (ref $cond)
0 0 if (@_ > 1) { }
0 0 unless (ref $cond)
0 0 if (@_ > 1) { }
0 0 unless (ref $cond)
0 0 if (@_ > 1) { }
0 0 unless (CORE::ref $cond)
0 0 if (@_ > 1) { }
0 0 unless (ref $cond)
0 0 if (@_ > 1) { }
0 0 if $self->[0][$fields{$f}]
0 0 if $self->[0][$fields{$f}]
0 0 if (@_ == 1) { }
0 0 if $self->[0][$fields{$f}]
0 0 if $self->[0][$fields{$f}]
0 0 if (@_ == 1) { }
0 0 if $self->[0][$fields{$f}]
0 0 if $self->[0][$fields{$f}]
0 0 if (@_ == 1) { }
0 0 if $self->[0][$fields{$f}]
0 0 if $self->[0][$fields{$f}]
0 0 if (@_ == 1) { }
0 0 if $self->[0][$fields{$f}]
0 0 if $self->[0][$fields{$f}]
0 0 if (@_ == 1) { }
0 0 if $self->[0][$fields{$f}]
0 0 if $self->[0][$fields{$f}]
0 0 if (@_ == 1) { }
0 0 if (@_ > 1)
0 4 if (@_ > 1)
1 0 if (defined $_[1] and CORE::ref $_[1] eq 'ARRAY')
1 0 if (defined $_[1] and CORE::ref $_[1] eq 'ARRAY')
0 0 if (exists $fields{$_[$i]}) { }
0 0 if (defined ${$insert{$_};}->[0]) { }
0 0 if (ref $insert{$_} eq 'ARRAY' and ref $insert{$_}[0] eq 'SCALAR') { }
0 0 elsif (ref $insert{$_} eq 'REF' and ref ${$insert{$_};} eq 'ARRAY') { }
0 0 elsif (ref $insert{$_} eq 'SCALAR') { }
3 0 if (defined $_[1] and ref $_[1] eq 'ARRAY') { }
0 0 elsif (defined $_[1]) { }
1 0 if (defined $_[1] and CORE::ref $_[1] eq 'ARRAY')
0 0 if (exists $fields{$_[$i]}) { }
0 0 if (defined ${$insert{$_};}->[0]) { }
0 0 if (ref $insert{$_} eq 'ARRAY' and ref $insert{$_}[0] eq 'SCALAR') { }
0 0 elsif (ref $insert{$_} eq 'REF' and ref ${$insert{$_};} eq 'ARRAY') { }
0 0 elsif (ref $insert{$_} eq 'SCALAR') { }
3 0 if (defined $_[1] and ref $_[1] eq 'ARRAY') { }
0 0 elsif (defined $_[1]) { }
3 0 if (exists $fields{$_[$i]}) { }
0 0 if (defined ${$insert{$_};}->[0]) { }
1 2 if (CORE::ref $insert{$_} eq 'ARRAY' and CORE::ref $insert{$_}[0] eq 'SCALAR') { }
0 2 elsif (CORE::ref $insert{$_} eq 'REF' and CORE::ref ${$insert{$_};} eq 'ARRAY') { }
1 1 elsif (CORE::ref $insert{$_} eq 'SCALAR') { }
3 3 if (defined $_[1] and CORE::ref $_[1] eq 'ARRAY') { }
3 0 elsif (defined $_[1]) { }
0 1 if (@_ > 1)
3 1 if (@_ > 1)
0 0 if (not CORE::ref $cond[0]) { }
0 3 if (@cond)
0 0 if (not CORE::ref $cond[0]) { }
0 0 if (@cond)
0 0 if (not ref $cond[0]) { }
0 0 if (@cond)
0 0 if (not ref $cond[0]) { }
0 0 if (@cond)
0 0 if (exists $fields{$_[$f]})
0 0 if (exists $fields{$_[$i]})
0 0 if (CORE::ref $_[1] eq 'ARRAY') { }
0 0 elsif (CORE::ref $_[1] eq 'HASH') { }
0 0 elsif (not CORE::ref $_[1]) { }
0 0 if (defined $_[1])
0 0 if (exists $fields{$_[$f]})
0 0 if (exists $fields{$_[$i]})
0 0 if (CORE::ref $_[1] eq 'ARRAY') { }
0 0 elsif (CORE::ref $_[1] eq 'HASH') { }
0 0 elsif (not CORE::ref $_[1]) { }
0 0 if (defined $_[1])
0 0 if (exists $fields{$_[$f]})
0 0 if (exists $fields{$_[$i]})
0 0 if (CORE::ref $_[1] eq 'ARRAY') { }
0 0 elsif (CORE::ref $_[1] eq 'HASH') { }
0 0 elsif (not CORE::ref $_[1]) { }
0 0 if (defined $_[1])
0 0 if (exists $fields{$_[$f]})
0 0 if (exists $fields{$_[$i]})
0 0 if (ref $_[1] eq 'ARRAY') { }
0 0 elsif (ref $_[1] eq 'HASH') { }
0 0 elsif (not ref $_[1]) { }
0 0 if (defined $_[1])
0 0 if (exists $fields{$_[$f]})
0 0 if (exists $fields{$_[$i]})
0 0 if (CORE::ref $_[1] eq 'ARRAY') { }
0 0 elsif (CORE::ref $_[1] eq 'HASH') { }
0 0 elsif (not CORE::ref $_[1]) { }
0 0 if (defined $_[1])
0 0 if (exists $fields{$_[$f]})
0 0 if (exists $fields{$_[$i]})
0 0 if (ref $_[1] eq 'ARRAY') { }
0 0 elsif (ref $_[1] eq 'HASH') { }
0 0 elsif (not ref $_[1]) { }
0 0 if (defined $_[1])
0 1 if @unknown_columns
0 0 if (defined ${$set_hash{$_};}->[0]) { }
0 1 if (CORE::ref $set_hash{$_} eq 'ARRAY' and CORE::ref $set_hash{$_}[0] eq 'SCALAR') { }
0 1 elsif (CORE::ref $set_hash{$_} eq 'REF' and CORE::ref ${$set_hash{$_};} eq 'ARRAY') { }
0 1 elsif (CORE::ref $set_hash{$_} eq 'SCALAR') { }
0 1 unless (CORE::ref $cond)
1 0 if (@_ > 2)
0 0 if (defined ${$column_value;}->[0]) { }
1 2 if (CORE::ref $column_value eq 'ARRAY' and CORE::ref $column_value->[0] eq 'SCALAR') { }
0 2 elsif (CORE::ref $column_value eq 'REF' and CORE::ref ${$column_value;} eq 'ARRAY') { }
1 1 elsif (CORE::ref $column_value eq 'SCALAR') { }
1 9 if (@_ > 1 and CORE::ref $_[1] eq 'HASH') { }
3 12 elsif (CORE::ref $self and @$self > 1 and %{$self->[1];}) { }
0 0 if @unknown_columns
0 0 if (defined ${$set_hash{$_};}->[0]) { }
0 0 if (ref $set_hash{$_} eq 'ARRAY' and ref $set_hash{$_}[0] eq 'SCALAR') { }
0 0 elsif (ref $set_hash{$_} eq 'REF' and ref ${$set_hash{$_};} eq 'ARRAY') { }
0 0 elsif (ref $set_hash{$_} eq 'SCALAR') { }
0 0 unless (ref $cond)
0 0 if (@_ > 2)
0 0 if (defined ${$column_value;}->[0]) { }
0 0 if (ref $column_value eq 'ARRAY' and ref $column_value->[0] eq 'SCALAR') { }
0 0 elsif (ref $column_value eq 'REF' and ref ${$column_value;} eq 'ARRAY') { }
0 0 elsif (ref $column_value eq 'SCALAR') { }
0 3 if (@_ > 1 and ref $_[1] eq 'HASH') { }
0 6 elsif (ref $self and @$self > 1 and %{$self->[1];}) { }
0 0 if @unknown_columns
0 0 if (defined ${$set_hash{$_};}->[0]) { }
0 0 if (ref $set_hash{$_} eq 'ARRAY' and ref $set_hash{$_}[0] eq 'SCALAR') { }
0 0 elsif (ref $set_hash{$_} eq 'REF' and ref ${$set_hash{$_};} eq 'ARRAY') { }
0 0 elsif (ref $set_hash{$_} eq 'SCALAR') { }
0 0 unless (ref $cond)
0 0 if (@_ > 2)
0 0 if (defined ${$column_value;}->[0]) { }
0 0 if (ref $column_value eq 'ARRAY' and ref $column_value->[0] eq 'SCALAR') { }
0 0 elsif (ref $column_value eq 'REF' and ref ${$column_value;} eq 'ARRAY') { }
0 0 elsif (ref $column_value eq 'SCALAR') { }
0 3 if (@_ > 1 and ref $_[1] eq 'HASH') { }
0 6 elsif (ref $self and @$self > 1 and %{$self->[1];}) { }
977 0 6 if $@
981 0 6 if ($interface)
1002 0 2 unless ref $table
1005 2 0 ref $table eq 'ARRAY' ? :
1016 0 6 if ('ARRAY' eq ref $le)
1023 3 3 if (substr($le, 0, 1) ne '-') { }
1025 3 0 unless $ta
1026 0 3 unless &_exists_row(scalar make_name($tn))
1034 0 3 if ($cmd eq 'left') { }
0 3 elsif ($cmd eq 'right') { }
1 2 elsif ($cmd eq 'join') { }
0 2 elsif ($cmd eq 'on') { }
0 2 elsif ($cmd eq 'using') { }
0 2 elsif ($cmd eq 'as') { }
0 2 elsif ($cmd eq 'where') { }
0 2 elsif ($cmd eq 'group_by') { }
0 2 elsif ($cmd eq 'having') { }
0 2 elsif ($cmd eq 'limit') { }
0 2 elsif ($cmd eq 'offset') { }
2 0 elsif ($cmd eq 'columns') { }
1058 0 2 if (ref $cols) { }
1066 0 2 unless @from
1071 0 1 if $from[$idx][3] or not $from[$idx - 1][2]
1072 0 1 if substr($from[$idx][0], 0, 1) eq '('
1078 0 1 unless $from[$i][2]
1080 0 1 if substr($ptn, 0, 1) eq '('
1082 1 0 if ($cto->can("foreignKey$ucfptn")) { }
1088 0 0 if ($ptno->can("foreignKey$ucct"))
1098 0 2 unless @columns
1101 2 1 unless ($joined)
1103 0 2 if $from[$idx][1] ne $from[$idx][0]
1105 1 2 if ($from[$idx][2]) { }
1109 0 1 if $nt->[1] ne $nt->[0]
1111 0 1 if ($using_on eq 'on' and ref $nt->[3][1]) { }
1121 0 2 if $idx != $#from
1126 0 2 unless (defined $where)
1129 0 0 if ($sql_grp and defined $having)
1134 0 0 if ($conditions) { }
1141 0 0 if (defined $sql_grp)
1145 0 0 if defined $limit
1146 0 0 if $offset
1148 0 2 if $where
1155 2 11 if (defined $groupby)
1157 0 2 /^\d+$/ ? :
0 2 ref $groupby ? :
1167 2 0 if (defined $having)
1177 6 7 unless defined $_[$i] and not ref $_[$i]
1178 2 5 if ($_[$i] eq '-group_by') { }
2 3 elsif ($_[$i] eq '-having') { }
0 3 elsif ($_[$i] eq '-order_by') { }
0 3 elsif ($_[$i] eq '-where') { }
0 3 elsif ($_[$i] eq '-limit') { }
0 3 elsif ($_[$i] eq '-interface') { }
0 3 elsif ($_[$i] eq '-offset') { }
1204 2 11 if ($sql_grp and defined $having)
1220 10 3 if ($simple_table) { }
1223 3 7 if ($have_conditions and not ref $conditions) { }
1224 0 3 unless my $id = ($ncn->selectKeys)[0]
1230 3 0 if (defined $conditions) { }
1242 10 3 if ($need_where)
1245 2 11 if (defined $sql_grp)
1249 0 13 if ($order)
1254 0 13 if (defined $limit)
1258 0 13 if (defined $offset)
1260 0 0 if $offset
1264 10 3 if ($simple_table) { }
1267 1 2 !ref($table) ? :
1274 0 13 unless $sth = $_->prepare($query)
1280 0 13 unless $sth->execute(@query_bind, @where_bind)
1291 6 7 unless ("$ncn"->can('dumpSQL'))
1293 0 6 if (@query_bind) { }
1310 1 12 unless $data
1320 0 0 if (ref $_[$i] eq 'CODE')
1330 0 0 if ($mapfunc) { }
1347 0 3 unless $simple_table