DBIx/Class/Storage/DBI/ODBC.pm

filter: Statementstmt 54.2% 19 / 35 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 60.0% 6 / 10 Podpod n/a totaltotal 34.7% 25 / 72 CC 11 SCAR 28.4
CC
11
Cov
33%
_using_freetds
30.0
_disable_odbc_array_ops
30.0
_using_freetds_version
12.0
CRAP 17.2
« DBIx/Class/Storage/DBI/Sybase/ASE/NoBindVars.pm ↑ Summary DBIx/Class/Storage/DBI/ODBC/ACCESS.pm »
1 package DBIx::Class::Storage::DBI::ODBC;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use base qw/DBIx::Class::Storage::DBI/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use mro 'c3';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use DBIx::Class::_Util 'modver_gt_or_eq';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub _rebless { shift->_determine_connector_driver('ODBC') }
Subroutine _rebless: not called CC=1 SCAR=6.9
11  
12 # Whether or not we are connecting via the freetds ODBC driver
13 sub _using_freetds {
14 0 ▶ my $self = shift;
Subroutine _using_freetds: not called CC=5 SCAR=34.0
15  
16 0 my $dsn = $self->_dbi_connect_info->[0];
17  
18 0 ▶ return 1 if (
Branch: 1 branch
BranchTrueFalseTotal
if not ref $dsn and $dsn =~ /driver=FreeTDS/i or ($self->_dbh_get_info("SQL_DRIVER_NAME") || "") =~ /tdsodbc/i 0 0 0
Condition0%0/8
not ref $dsn and $dsn =~ /driver=FreeTDS/i or ($self->_dbh_get_info("SQL_DRIVER_NAME") || "") =~ /tdsodbc/i
l!l&&r!l&&!r
000
not ref $dsn and $dsn =~ /driver=FreeTDS/i
!ll&&!rl&&r
000
$self->_dbh_get_info('SQL_DRIVER_NAME') || ''
l!l
00
MC/DC0%0/3
not ref $dsn and $dsn =~ /driver=FreeTDS/i or ($self->_dbh_get_info("SQL_DRIVER_NAME") || "") =~ /tdsodbc/i
not ref $dsn $dsn =~ /driver=FreeTDS/i $self->_dbh_get_info('SQL_DRIVER_NAME')
Truth table0%0/5
not(A) and B or C
A= not ref $dsnB= $dsn =~ /driver=FreeTDS/iC= $self->_dbh_get_info('SQL_DRIVER_NAME')
ABCresult
11X1
0X11
1011
0X00
1000
19 ( (! ref $dsn) and $dsn =~ /driver=FreeTDS/i)
20 or
21 ( ($self->_dbh_get_info('SQL_DRIVER_NAME')||'') =~ /tdsodbc/i )
22 );
23  
24 0 return 0;
25 }
26  
27 # Either returns the FreeTDS version via which we are connecting, 0 if can't
28 # be determined, or undef otherwise
29 sub _using_freetds_version {
30 0 ▶ my $self = shift;
Subroutine _using_freetds_version: not called CC=3 SCAR=24.8
31 0 ▶ return undef unless $self->_using_freetds;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_using_freetds 0 0 0
32 0 ▶ return $self->_dbh_get_info('SQL_DRIVER_VER') || 0;
Condition0%0/2
$self->_dbh_get_info('SQL_DRIVER_VER') || 0
l!l
00
MC/DC0%0/1
$self->_dbh_get_info('SQL_DRIVER_VER') || 0
$self->_dbh_get_info('SQL_DRIVER_VER')
Truth table0%0/2
A
A= $self->_dbh_get_info('SQL_DRIVER_VER')
Aresult
11
00
33 }
34  
35 sub _disable_odbc_array_ops {
36 0 ▶ my $self = shift;
Subroutine _disable_odbc_array_ops: not called CC=5 SCAR=34.0
37 0 my $dbh = $self->_get_dbh;
38  
39 0 ▶ $DBD::ODBC::__DBIC_DISABLE_ARRAY_OPS_VIA__ ||= [ do {
Condition0%0/2
$DBD::ODBC::__DBIC_DISABLE_ARRAY_OPS_VIA__ ||= [do { if (&modver_gt_or_eq("DBD::ODBC", "1.35_01")) { "odbc_array_operations", 0; } elsif (&modver_gt_or_eq("DBD::ODBC", "1.33_01")) { "odbc_disable_array_operations", 1; } }]
l!l
00
MC/DC0%0/1
$DBD::ODBC::__DBIC_DISABLE_ARRAY_OPS_VIA__ ||= [do { if (&modver_gt_or_eq("DBD::ODBC", "1.35_01")) { "odbc_array_operations", 0; } elsif (&modver_gt_or_eq("DBD::ODBC", "1.33_01")) { "odbc_disable_array_operations", 1; } }]
$DBD::ODBC::__DBIC_DISABLE_ARRAY_OPS_VIA__
Truth table0%0/2
A
A= $DBD::ODBC::__DBIC_DISABLE_ARRAY_OPS_VIA__
Aresult
11
00
40 0 ▶ if( modver_gt_or_eq('DBD::ODBC', '1.35_01') ) {
Branch: 2 branches
BranchTrueFalseTotal
if (&modver_gt_or_eq('DBD::ODBC', '1.35_01')) { } 0 0 0
elsif (&modver_gt_or_eq('DBD::ODBC', '1.33_01')) { } 0 0 0
41 0 odbc_array_operations => 0;
42 }
43 elsif( modver_gt_or_eq('DBD::ODBC', '1.33_01') ) {
44 0 odbc_disable_array_operations => 1;
45 }
46 }];
47  
48 0 ▶ if (my ($k, $v) = @$DBD::ODBC::__DBIC_DISABLE_ARRAY_OPS_VIA__) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = @$DBD::ODBC::__DBIC_DISABLE_ARRAY_OPS_VIA__) 0 0 0
49 0 $dbh->{$k} = $v;
50 }
51 }
52  
53 2 1;
54  
55 =head1 NAME
56  
57 DBIx::Class::Storage::DBI::ODBC - Base class for ODBC drivers
58  
59 =head1 DESCRIPTION
60  
61 This class simply provides a mechanism for discovering and loading a sub-class
62 for a specific ODBC backend. It should be transparent to the user.
63  
64 =head1 AUTHOR
65  
66 See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
67  
68 =head1 LICENSE
69  
70 You may distribute this code under the same terms as Perl itself.
71  
72 =cut
73 # vim:sts=2 sw=2:
« DBIx/Class/Storage/DBI/Sybase/ASE/NoBindVars.pm ↑ Summary DBIx/Class/Storage/DBI/ODBC/ACCESS.pm »