Branch Coverage

blib/lib/Class/ReluctantORM/SQL.pm
Criterion Covered Total %
branch 0 398 0.0


line true false branch
196 0 0 unless ($op)
197 0 0 unless (exists $OPERATIONS{uc $op})
251 0 0 unless (exists $permitted{$self->operation})
254 0 0 unless (blessed $col and $col->isa('Class::ReluctantORM::SQL::Column'))
258 0 0 unless ($self->input_subquery)
259 0 0 unless (blessed $param and $param->isa('Class::ReluctantORM::SQL::Param'))
291 0 0 if (blessed $oc and $oc->isa(Expression())) { }
0 0 elsif (not blessed $oc && $oc->isa(OutputColumn())) { }
299 0 0 unless (exists $permitted{$self->operation})
368 0 0 $self->raw_where ? :
0 0 $self->where ? :
375 0 0 $self->input_subquery ? :
0 0 $self->raw_where ? :
0 0 $self->where ? :
395 0 0 if (@_)
397 0 0 unless (blessed $sq and $sq->isa(SubQuery()))
400 0 0 unless ($self->operation eq 'INSERT')
419 0 0 if (@vals < @params) { }
0 0 elsif (@vals > @params) { }
441 0 0 if (@_)
443 0 0 if (not ref $thing) { }
0 0 elsif ($thing->isa(From())) { }
476 0 0 if (@_)
478 0 0 if (not defined $thing) { }
0 0 elsif (not ref $thing) { }
508 0 0 unless ($self->operation eq 'INSERT' or $self->operation eq 'UPDATE')
509 0 0 unless $$self{'inputs'}
522 0 0 if ($self->operation eq 'INSERT' or $self->operation eq 'UPDATE') { }
523 0 0 if ($self->input_subquery) { }
570 0 0 if (@_)
585 0 0 if (@_)
589 0 0 unless ($ob)
621 0 0 if ($self->operation eq 'SELECT')
622 0 0 if (@_)
624 0 0 unless (blessed $t and $t->isa(Table()))
636 0 0 if (@_)
639 0 0 if ($sql->operation eq 'SELECT') { }
667 0 0 if ($self->operation eq 'SELECT') { }
668 0 0 unless ($self->from)
671 0 0 $self->from ? :
673 0 0 $self->table ? :
676 0 0 $self->where ? :
695 0 0 if (@_)
697 0 0 if (not ref $thing) { }
0 0 elsif ($thing->isa(Where())) { }
728 0 0 if (@_)
730 0 0 if (not defined $thing) { }
0 0 elsif (not ref $thing) { }
751 0 0 if (@_)
759 0 0 if (@_)
766 0 0 if (@_)
783 0 0 if (@_)
786 0 0 unless $self->get('raw_where_params')
821 0 0 unless (defined $args{'auto_annotate'})
822 0 0 unless (defined $args{'auto_reconcile'})
823 0 0 unless (defined $args{'add_output_columns'})
828 0 0 if ($@)
829 0 0 wantarray ? :
845 0 0 if ($inflatable)
852 0 0 wantarray ? :
859 0 0 $base_table->class ? :
864 0 0 scalar $sql->output_columns ? :
884 0 0 if ($sql->from)
886 0 0 unless $ok
890 0 0 unless $ok
891 0 0 unless $table
895 0 0 if $rel->join_depth > 1 and not grep({$_->is_the_same_table($table);} $sql->tables('exclude_subqueries', 1))
903 0 0 $ok ? :
908 0 0 if ($oc->expression->is_column) { }
910 0 0 if ($col->table) { }
911 0 0 if ($col->table->schema) { }
937 0 0 unless $ok
940 0 0 unless ($check)
961 0 0 if (@non_join_tables == 1 and $non_join_tables[0]->is_the_same_table($sql->base_table))
965 0 0 unless ($sql->from)
976 0 0 if ($rel_table and $table->is_the_same_table($rel_table))
991 0 0 unless ($sql->from)
994 0 0 unless ($j->relationship)
1032 0 0 unless (defined $args{'auto_annotate'})
1033 0 0 unless (defined $args{'auto_reconcile'})
1034 0 0 unless (defined $args{'add_output_columns'})
1036 0 0 if ($args{'auto_annotate'})
1039 0 0 if ($args{'auto_reconcile'})
1055 0 0 if ('Class::ReluctantORM'->_is_join_table('table_obj', $table)) { }
0 0 elsif (not $table->class) { }
1063 0 0 if ($class)
1070 0 0 if ($sql->from)
1087 0 0 unless ($rel->is_join)
1093 0 0 if ($join->relationship)
1107 0 0 if (@candidates == 0)
1109 0 0 unless $_->remote_sql_table and $right_table->is_the_same_table($_->remote_sql_table, 0)
1119 0 0 if (@candidates == 0)
1121 0 0 unless $_->remote_sql_table and $left_table->is_the_same_table($_->remote_sql_table, 0)
1134 0 0 if (@candidates == 0)
1136 0 0 unless $_->remote_sql_table and $right_table->is_the_same_table($_->local_sql_table, 0)
1146 0 0 if (@candidates == 0)
1148 0 0 unless $_->remote_sql_table and $left_table->is_the_same_table($_->local_sql_table, 0)
1163 0 0 if (@candidates == 0) { }
0 0 elsif (@candidates > 1) { }
1252 0 0 if ($options{'add_output_columns'})
1267 0 0 if ($sql->operation eq 'DELETE')
1271 0 0 if ($table->class)
1279 0 0 if ($sql->from)
1291 0 0 if ($self->operation eq 'SELECT') { }
1292 0 0 $self->from ? :
1294 0 0 $self->table ? :
1313 0 0 if ($self->operation eq 'SELECT')
1315 0 0 if ($join->relationship)
1321 0 0 if ($rel->join_depth > 1)
1347 0 0 if ($thing->is_subquery)
1359 0 0 if ($sql->from) { }
0 0 elsif ($sql->table) { }
1366 0 0 if ($sql->where)
1371 0 0 if ($sql->input_subquery)
1381 0 0 $sql->where ? :
0 0 $sql->order_by ? :
1388 0 0 unless $info
1391 0 0 if ($$info{'type'} eq 'base') { }
1397 0 0 if (@matching_relations != 1)
1404 0 0 if $_->relationship
1408 0 0 if ($$info{'type'} eq 'parent') { }
0 0 elsif ($$info{'type'} eq 'child') { }
0 0 elsif ($$info{'type'} eq 'join') { }
1425 0 0 unless ($table)
1448 0 0 unless ($table)
1450 0 0 unless ($name)
1453 0 0 if ($type)
1457 0 0 unless ($type eq 'base')
1458 0 0 if ($sql->from)
1460 0 0 unless ($lcrelname)
1476 0 0 if ($self->raw_where) { }
0 0 elsif ($self->where) { }
1478 0 0 if ($$self{'reconcile_options'}{'realias_raw_sql'}) { }
1499 0 0 if $already_bound
1501 0 0 unless defined $sql->_raw_where_execargs
1503 0 0 unless $sql->_raw_where_execargs
1521 0 0 if ($sql->operation eq 'SELECT') { }
1529 0 0 if (my($type, $relname) = $working =~ /$amre/)
1531 0 0 if ($type eq 'base') { }
0 0 elsif ($type eq 'parent') { }
0 0 elsif ($type eq 'child') { }
0 0 elsif ($type eq 'join') { }
1552 0 0 if ($t->schema)
1555 0 0 if ($DEBUG > 2)
1559 0 0 if ($t->schema)
1562 0 0 if ($DEBUG > 2)
1568 0 0 if ($DEBUG > 2)
1573 0 0 if ($DEBUG > 2)
1598 0 0 if ($expr->is_column)
1645 0 0 unless $self->order_by
1653 0 0 unless $sql->from
1658 0 0 if ($expr->is_column)
1687 0 0 if ($table) { }
1690 0 0 if ($DEBUG > 2)
1693 0 0 if (exists $cache{'by_mem'}{'' . $table . ''})
1696 0 0 if ($table->alias and exists $cache{'by_alias'}{$table->alias})
1702 0 0 if ($table->schema and exists $cache{'by_schema'}{$table->schema . '.' . $table->table})
1708 0 0 unless $cache{'by_name'}{$table->table}
1709 0 0 if (@tables_with_that_name == 1) { }
0 0 elsif (@tables_with_that_name == 0) { }
1714 0 0 $_->schema ? :
1719 0 0 unless $cache{'by_column'}{lc $col->column}
1721 0 0 if (@tables_with_that_column == 1) { }
0 0 elsif (@tables_with_that_column == 0) { }
1726 0 0 $_->schema ? :
0 0 $_->alias ? :
1770 0 0 unless ($sql->is_prepared)
1775 0 0 if (@_)
1810 0 0 unless ($sql->is_prepared)
1830 0 0 unless ($sql->is_prepared)
1852 0 0 unless ($sql->is_prepared)
1892 0 0 unless (ref $coderef eq 'CODE')
1920 0 0 if ($row) { }
1954 0 0 if ($op ne 'DELETE')
1960 0 0 if ($op ne 'SELECT') { }
1966 0 0 if ($op eq 'INSERT' or $op eq 'UPDATE')
1969 0 0 if ($op eq 'INSERT' and $self->input_subquery)
1973 0 0 if ($op ne 'INSERT')
1974 0 0 if ($self->_cooked_where) { }
0 0 elsif ($self->raw_where) { }
0 0 elsif ($self->where) { }
1982 0 0 if ($self->order_by)
1985 0 0 if (defined $self->limit)
1987 0 0 if (defined $self->offset)
2002 0 0 if ($$i{'param'})
2033 0 0 if ($exp->is_column) { }
2071 0 0 if (defined $self->limit)
2072 0 0 if (defined $self->offset)
2073 0 0 if (defined $self->raw_where)
2075 0 0 if ($self->_cooked_where)
2076 0 0 if ($self->_raw_where_execargs)
2077 0 0 if ($self->_raw_where_params)
2081 0 0 if ($self->where)
2082 0 0 if ($self->get('table'))
2083 0 0 if ($self->from)
2084 0 0 if ($self->order_by)
2085 0 0 if ($self->input_subquery)
2108 0 0 if ($sql->from and $sql->from->root_relation)
2109 0 0 if ($sql->where and $sql->where->root_criterion)