Branch Coverage

blib/lib/DBI/DBD/SqlEngine.pm
Criterion Covered Total %
branch 211 362 58.2


line true false branch
61 0 44 if $DBI::DBD::SqlEngine::drh->{$class}
66 0 44 unless ($attr->{'Attribution'})
69 0 0 if $class eq 'DBI::DBD::SqlEngine'
74 0 44 unless $attr->{'Name'}
81 44 0 if ($prefix) { }
87 0 220 if $dbclass->can($method)
109 42 2 unless $DBI::DBD::SqlEngine::methods_installed{'__PACKAGE__'}++
146 580 0 if ($dbh)
151 580 0 if defined $dbh->{'sql_init_phase'}
156 0 580 if exists $attr->{'RootClass'}
161 804 332 if ($dbname =~ s/^((?:[^\\;]|\\.)*?);//s) { }
171 1136 0 if ($var =~ /^(.+?)=(.*)/s) { }
0 0 elsif ($var =~ /^(.+?)=>(.*)/s) { }
175 1136 0 if $^W
178 1136 0 unless exists $attr->{$var}
207 0 580 unless $dbh->{'sql_init_order'}
211 1744 4172 defined $order{$_} ? :
217 0 5916 unless exists $attr->{$a}
218 5916 0 if $two_phased_init
222 0 5916 if $@
223 0 5916 unless $two_phased_init
226 580 0 if $two_phased_init
252 0 32 if $attr and defined $attr->{'sql_table_source'} and $attr->{'sql_table_source'}->isa('DBI::DBD::SqlEngine::TableSource')
256 32 0 if not defined $tbl_src and $drh->{'ImplementorClass'}->can('default_table_source')
257 0 32 unless defined $tbl_src
296 348 0 $_[0]->FETCH('Active') ? :
303 0 24 unless ref $attr eq 'HASH'
304 24 0 unless defined $attr->{'sql_table_source'}
315 732 0 if ($sth)
325 0 732 if ($class->isa('SQL::Statement')) { }
329 0 0 if ($@) { }
342 48 684 if ($@ or $stmt->{'errstr'}) { }
365 580 580 unless defined $DBI::SQL::Nano::versions->{$_}
370 0 580 $dbh->{'sql_statement_version'} ? :
418 0 1160 unless (defined $phase)
422 0 0 if $phase
425 580 580 if (0 == $phase)
460 386 194 $dbh->{$drv_pfx_meta} ? :
470 386 194 if (exists $dbh->{$drv_pfx_meta} and not $dbh->{'sql_engine_in_gofer'})
476 0 386 if defined $attr and defined $dbh->{$valid_attrs} and not defined $dbh->{$valid_attrs}{$attr}
490 0 2126 if defined $dbh->{$valid_attrs} and not defined $dbh->{$valid_attrs}{$attr}
493 0 2126 if defined $dbh->{$ro_attrs} and not defined $dbh->{$ro_attrs}{$attr}
502 580 0 if defined $_[0]{'sql_init_phase'}
526 28 0 unless ($dbh2)
529 0 28 unless ($dbh2)
556 0 0 if ($dbh->{'sql_engine_in_gofer'})
560 0 0 if exists $$dbh{$drv_prefix . 'meta'} and $attrib eq $$dbh{$drv_prefix . 'meta'}
570 0 3676 if $attrib eq 'AutoCommit'
574 0 3676 if ($attrib eq lc $attrib)
578 0 0 unless $attrib = $dbh->func($attrib, 'validate_FETCH_attr')
581 0 0 if $attrib =~ /^([a-z]+_)/
582 0 0 unless ($attr_prefix)
592 0 0 if exists $dbh->{$valid_attrs}
598 0 0 if exists $dbh->{$ro_attrs} and $dbh->{$ro_attrs}{$attrib} and defined $dbh->{$attrib} and refaddr($dbh->{$attrib})
610 0 68 if ($attrib eq 'sql_identifier_case' || $attrib eq 'sql_quoted_identifier_case' and $value < 1 || $value > 4)
621 4 4084 if exists $$dbh{$drv_prefix . 'meta'} and $attrib eq $$dbh{$drv_prefix . 'meta'}
639 772 9046 if ($attrib eq 'AutoCommit')
641 772 0 if $value
645 4088 4958 if ($attrib eq lc $attrib)
650 0 4088 unless $attrib
653 4088 0 if $attrib =~ /^([a-z]+_)/
654 0 4088 unless ($attr_prefix)
664 2400 1688 if exists $dbh->{$valid_attrs}
668 0 2396 if exists $dbh->{$ro_attrs} and $dbh->{$ro_attrs}{$attrib} and defined $dbh->{$attrib}
672 36 4048 if ($attrib eq 'sql_meta') { }
705 0 16 $dbh->{'sql_handler'} eq 'SQL::Statement' ? :
712 16 24 if $derived eq 'DBI::DBD::SqlEngine::db'
713 0 24 unless $derived->isa('DBI::DBD::SqlEngine::db')
720 24 0 $ddgv ? :
724 8 16 if $indent
729 16 0 if $indent
731 8 8 if $DBI::PurePerl
736 14 141 if $a->isa($b)
737 15 126 if $b->isa($a)
738 40 86 if $a->isa('DBI::DBD::SqlEngine')
739 29 57 if $b->isa('DBI::DBD::SqlEngine')
743 0 16 wantarray ? :
751 0 62 if $table eq '.'
756 0 62 unless $meta
769 0 38 if $table eq '*'
771 0 38 if $table eq '+'
773 0 38 if ref $table eq 'Regexp'
775 28 10 unless ref $table or ref $attr
778 2 8 unless ref $table
779 0 10 unless ref $attr
780 0 10 unless 'ARRAY' eq ref $table
784 0 10 unless 'ARRAY' eq ref $attr
807 0 6 unless 'HASH' eq ref $values
810 0 6 if $table =~ s/^\"//
813 6 0 unless ($respect_case)
815 0 6 if defined $dbh->{'sql_meta_map'}{$table}
820 2 4 if defined $values->{'sql_table_class'}
821 4 2 unless defined $class
832 0 8 if $table eq '.'
837 0 8 unless $meta
850 0 8 if $table eq '*'
852 0 8 if $table eq '+'
854 0 8 if ref $table eq 'Regexp'
856 4 4 unless ref $table or ref $attr
859 4 0 unless ref $table
860 0 4 unless ref $attr
861 0 4 unless 'ARRAY' eq ref $table
864 0 4 unless 'HASH' eq ref $attr
884 4 0 if $meta
892 194 0 if $dbh->SUPER::FETCH('Active')
942 0 0 if ($dbh->{'sql_handler'} eq 'SQL::Statement' and $dbh->{'sql_ram_tables'})
954 0 36 if defined $dbh->{'sql_table_source'} and $dbh->{'sql_table_source'}->isa('DBI::DBD::SqlEngine::TableSource')
958 36 0 if not defined $tbl_src and $dbh->{'Driver'}{'ImplementorClass'}->can('default_table_source')
959 36 0 if defined $tbl_src
984 0 28 unless $sth
985 0 28 unless $sth->execute
995 0 8 unless my(@tables) = $dbh->func('get_avail_tables')
1008 0 0 unless defined $str
1009 0 0 if defined $type and $type == &DBI::SQL_NUMERIC() || $type == &DBI::SQL_DECIMAL() || $type == &DBI::SQL_INTEGER() || $type == &DBI::SQL_SMALLINT() || $type == &DBI::SQL_FLOAT() || $type == &DBI::SQL_REAL() || $type == &DBI::SQL_DOUBLE() || $type == &DBI::SQL_TINYINT()
1030 0 0 if $dbh->FETCH('Warn')
1038 0 0 if $dbh->FETCH('Warn')
1139 0 0 unless 'HASH' eq ref $tbl_meta
1143 0 0 unless $meta
1158 0 24 unless $meta
1180 0 0 unless exists $_[0]{'dbh'}{'sql_meta'}{$_[1]}
1188 0 0 unless $meta
1218 0 108 if ($attr and defined $val)
1220 0 0 ref $attr eq 'HASH' ? :
1221 0 0 if ($type == &DBI::SQL_BIGINT() or $type == &DBI::SQL_INTEGER() or $type == &DBI::SQL_SMALLINT() or $type == &DBI::SQL_TINYINT()) { }
0 0 elsif ($type == &DBI::SQL_DECIMAL() or $type == &DBI::SQL_DOUBLE() or $type == &DBI::SQL_FLOAT() or $type == &DBI::SQL_NUMERIC() or $type == &DBI::SQL_REAL()) { }
1248 8 476 @_ ? :
1255 484 0 unless ($sth->{'sql_params_checked'}++)
1260 0 484 unless ((my $req_prm = $stmt->params) == (my $nparm = @$params))
1273 32 452 unless (defined $result)
1279 94 358 if ($stmt->{'NUM_OF_FIELDS'})
1283 46 48 unless $sth->FETCH('NUM_OF_FIELDS')
1300 64 258 if (not $data or ref $data ne 'ARRAY')
1309 82 176 unless ($dav)
1314 0 176 if ($sth->FETCH('ChopBlanks'))
1333 632 1404 if ($sth->{'sql_stmt'}{'NAME'} and 'ARRAY' eq ref $sth->{'sql_stmt'}{'NAME'}) { }
0 1404 elsif ($sth->{'sql_stmt'}->isa('SQL::Statement')) { }
1340 0 0 unless $stmt->{'column_defs'}
1341 0 0 unless $_->{'name'}
1343 1404 632 unless @colnames
1345 0 2036 if grep {/\*/;} @colnames
1354 336 1682 if $attrib eq 'NAME'
1356 340 1342 if $attrib eq 'TYPE'
1357 4 1338 if $attrib eq 'TYPE_NAME'
1358 336 1002 if $attrib eq 'PRECISION'
1359 72 930 if $attrib eq 'NULLABLE'
1361 336 594 if ($attrib eq lc $attrib)
1374 1368 1568 if ($attrib eq lc $attrib)
1385 12 720 if $sth->SUPER::FETCH('Active')
1407 0 0 ref $_[0] ? :
1413 0 0 ref $_[0] ? :
1428 0 0 ref $_[0] ? :
1434 0 0 ref $_[0] ? :
1459 120 364 if $self->{'command'} eq 'DROP'
1461 0 484 unless my($tblnm, $table_meta) = $class->get_table_meta($data->{'Database'}, $table, 1)
1464 2 482 if defined $table_meta->{'sql_table_class'}
1471 382 102 if ($write_op)
1476 24 0 $lockMode ? :
24 358 if $table_meta->{'readonly'}
1500 16 506 if defined $dbh->{'ReadOnly'} and not defined $meta->{'readonly'}
1502 484 38 unless defined $meta->{'sql_identifier_case'}
1504 488 34 unless exists $meta->{'sql_data_source'}
1519 1048 176 unless (defined $respect_case)
1522 0 1048 if $table =~ s/^\"//
1526 1224 0 unless ($respect_case)
1528 310 914 if defined $dbh->{'sql_meta_map'}{$table}
1532 778 446 if defined $dbh->{'sql_meta'}{$table}
1535 514 744 unless ($meta->{'initialized'})
1538 128 386 unless $meta->{'sql_data_source'}->complete_table_name($meta, $table, $respect_case, @other)
1541 178 208 if (defined $meta->{'table_name'} and $table ne $meta->{'table_name'})
1549 70 316 if (defined $dbh->{'sql_meta'}{$table})
1553 34 36 unless $meta->{'initialized'}
1558 352 0 unless ($dbh->{'sql_meta'}{$table}{'initialized'})
1579 104 228 ref $extra_resets->{$cv} ? :
1595 0 82 if exists $compat_map{$attrib}
1597 82 0 if exists $meta->{$attrib}
1605 4 8 if exists $compat_map{$attrib}
1615 12 0 if defined $reset_on_modify{$attrib} and delete @$meta{@{$reset_on_modify{$attrib};}}
1623 0 460 unless $meta->{'sql_data_source'}
1636 0 460 unless my($tblnm, $meta) = $className->get_table_meta($dbh, $attrs->{'table'}, 1)
1643 0 62 if $flags->{'createMode'} and $data->{'sql_stmt'}{'table_defs'}
1661 16 396 if $self->{'row'}