DBH/mysql.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 3 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 24 CC 2 SCAR 13.9
CC
2
Cov
0%
connect_data
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.0
1 package DBIx::DBH::mysql ;
2
3 use base qw(DBIx::DBH);
4 use Params::Validate qw( :all );
5
6 @optional_mysql_ = qw(mysql_client_found_rows
7 mysql_compression
8 mysql_connect_timeout
9 mysql_read_default_file
10 mysql_read_default_group
11 mysql_socket
12 mysql_ssl
13 mysql_ssl_client_key
14 mysql_ssl_client_cert
15 mysql_ssl_ca_file
16 mysql_ssl_ca_path
17 mysql_ssl_cipher
18 mysql_local_infile);
19
20
21 sub connect_data {
22
23 my $class = shift;
24
25 my %p = @_;
26
27 %p = validate( @_, { driver => { type => SCALAR },
28 dbname => { type => SCALAR },
29 user => { type => SCALAR | UNDEF,
30 optional => 1 },
31 password => { type => SCALAR | UNDEF,
32 optional => 1 },
33 host => { type => SCALAR | UNDEF,
34 optional => 1 },
35 port => { type => SCALAR | UNDEF,
36 optional => 1 },
37 map { $_ => 0 } (@optional_mysql_, @DBIx::DBH::attr)
38 } );
39
40 my $dsn = "DBI:$p{driver}:$p{dbname}";
41 foreach ( qw( host port ) ) {
42 $dsn .= ";$_=$p{$_}" if (defined $p{$_});
43 }
44
45
46 foreach my $k ( grep { /^mysql/ } sort keys %p )
47 {
48 $dsn .= ";$k=$p{$k}";
49 }
50
51
52 ($dsn, $p{user}, $p{password}, $p{attr});
53
54 }
55
56
57 1;
58
59 =head1 NAME
60
61 DBIx::DBH::mysql - mysql DBI database handle connection specifics.
62
63 =head1 connect()
64
65 L<DBIx::DBH> covered the options available to any database driver. Here we
66 list optional arguments supported by MySQL. Please read L<DBD::mysql> for
67 details. All of these arguments apply to the DSN.
68
69 =over 4
70
71 =item * mysql_client_found_rows
72 =item * mysql_compression
73 =item * mysql_connect_timeout
74 =item * mysql_read_default_file
75 =item * mysql_read_default_group
76 =item * mysql_socket
77 =item * mysql_ssl
78 =item * mysql_ssl_client_key
79 =item * mysql_ssl_client_cert
80 -item * mysql_ssl_ca_file
81 -item * mysql_ssl_ca_path
82 -item * mysql_ssl_cipher
83 -item * mysql_local_infile
84
85
86 =back
87
88 =cut