line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBD::BlackHole; |
2
|
6
|
|
|
6
|
|
4446
|
use 5.008001; |
|
6
|
|
|
|
|
19
|
|
3
|
6
|
|
|
6
|
|
33
|
use strict; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
166
|
|
4
|
6
|
|
|
6
|
|
36
|
use warnings; |
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
338
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.02"; |
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
1773
|
use DBI; |
|
6
|
|
|
|
|
18159
|
|
|
6
|
|
|
|
|
1212
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $drh = undef; |
11
|
|
|
|
|
|
|
our $err = ''; |
12
|
|
|
|
|
|
|
our $errstr = ''; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub driver { |
15
|
5
|
|
|
5
|
0
|
763
|
my ($class, $attr) = @_; |
16
|
5
|
|
33
|
|
|
66
|
return $drh ||= DBI::_new_drh("${class}::dr", { |
17
|
|
|
|
|
|
|
Name => 'BlackHole', |
18
|
|
|
|
|
|
|
Version => $VERSION, |
19
|
|
|
|
|
|
|
Attribution => 'BlackHole DBD driver', |
20
|
|
|
|
|
|
|
Err => \$err, |
21
|
|
|
|
|
|
|
Errstr => \$errstr, |
22
|
|
|
|
|
|
|
}); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub CLONE { |
26
|
0
|
|
|
0
|
|
0
|
undef $drh; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
package DBD::BlackHole::dr; |
30
|
6
|
|
|
6
|
|
36
|
use strict; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
149
|
|
31
|
6
|
|
|
6
|
|
24
|
use warnings; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
710
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
our $imp_data_size = 0; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub connect { |
36
|
5
|
50
|
|
5
|
|
737
|
my $dbh = shift->SUPER::connect(@_) |
37
|
|
|
|
|
|
|
or return; |
38
|
5
|
|
|
|
|
306
|
$dbh->STORE(Active => 1); |
39
|
5
|
|
|
|
|
20
|
return $dbh; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
|
0
|
sub data_sources { qw/dbi:BlackHole:/ } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
package DBD::BlackHole::db; |
45
|
6
|
|
|
6
|
|
30
|
use strict; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
199
|
|
46
|
6
|
|
|
6
|
|
54
|
use warnings; |
|
6
|
|
|
|
|
21
|
|
|
6
|
|
|
|
|
947
|
|
47
|
|
|
|
|
|
|
|
48
|
6
|
|
|
6
|
|
37
|
use Carp qw/croak/; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
410
|
|
49
|
|
|
|
|
|
|
|
50
|
6
|
|
|
6
|
|
29
|
use constant DEFAULT_IDENTIFIER => '`'; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
2454
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
our $imp_data_size = 0; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub get_info { |
55
|
3
|
|
|
3
|
|
815
|
my ($dbh, $type) = @_; |
56
|
|
|
|
|
|
|
# identifier quote |
57
|
3
|
100
|
50
|
|
|
12
|
return $dbh->FETCH('blackhole_identifier') || DEFAULT_IDENTIFIER if $type == 29; |
58
|
2
|
|
|
|
|
4
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub prepare { |
62
|
11
|
|
|
11
|
|
4865
|
my ($dbh, $statement)= @_; |
63
|
|
|
|
|
|
|
|
64
|
11
|
|
|
|
|
43
|
my $sth = DBI::_new_sth($dbh, { |
65
|
|
|
|
|
|
|
Statement => $statement, |
66
|
|
|
|
|
|
|
}); |
67
|
11
|
|
|
|
|
280
|
return $sth; |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
2
|
|
|
2
|
|
359
|
sub ping { shift->FETCH('Active') } |
71
|
|
|
|
|
|
|
|
72
|
6
|
|
|
6
|
|
28
|
sub disconnect { shift->STORE(Active => 0) } |
73
|
|
|
|
|
|
|
|
74
|
2
|
|
|
2
|
|
24
|
sub begin_work { 1 } |
75
|
1
|
|
|
1
|
|
6
|
sub commit { 1 } |
76
|
1
|
|
|
1
|
|
5
|
sub rollback { 1 } |
77
|
|
|
|
0
|
|
|
sub tables {} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub FETCH { |
80
|
5
|
|
|
5
|
|
830
|
my $dbh = shift; |
81
|
5
|
|
|
|
|
37
|
my $key = shift; |
82
|
5
|
50
|
|
|
|
16
|
return 1 if $key eq 'AutoCommit'; |
83
|
5
|
|
|
|
|
67
|
return $dbh->SUPER::FETCH($key); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub STORE { |
87
|
32
|
|
|
32
|
|
393
|
my $dbh = shift; |
88
|
32
|
|
|
|
|
54
|
my ($key, $value) = @_; |
89
|
|
|
|
|
|
|
|
90
|
32
|
100
|
|
|
|
90
|
if ($key eq 'AutoCommit') { |
91
|
5
|
50
|
33
|
|
|
22
|
croak 'Cannot disable AutoCommit' if !$value && $dbh->FETCH('AutoCommit'); |
92
|
5
|
|
|
|
|
23
|
return $value; |
93
|
|
|
|
|
|
|
} |
94
|
27
|
|
|
|
|
551
|
return $dbh->SUPER::STORE($key, $value); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
5
|
|
|
5
|
|
3351
|
sub DESTROY { shift->disconnect } |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
package DBD::BlackHole::st; |
100
|
6
|
|
|
6
|
|
31
|
use strict; |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
120
|
|
101
|
6
|
|
|
6
|
|
23
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
1014
|
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
our $imp_data_size = 0; |
104
|
|
|
|
|
|
|
|
105
|
1
|
|
|
1
|
|
13
|
sub bind_col { 1 } |
106
|
0
|
|
|
0
|
|
0
|
sub bind_param { 1 } |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
sub execute { |
109
|
11
|
|
|
11
|
|
2604
|
my $sth = shift; |
110
|
11
|
|
|
|
|
63
|
$sth->STORE(NUM_OF_FIELDS => 0); |
111
|
11
|
|
|
|
|
34
|
$sth->STORE(NUM_OF_PARAMS => 0); |
112
|
11
|
|
|
|
|
21
|
1; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
5
|
|
|
5
|
|
2319
|
sub rows { '0E0' } |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
13
|
|
|
sub fetch {} |
118
|
|
|
|
|
|
|
|
119
|
1
|
|
|
1
|
|
12
|
sub fetchall_hashref { +{} } |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
1; |
122
|
|
|
|
|
|
|
__END__ |