line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBD::BlackHole; |
2
|
7
|
|
|
7
|
|
4498
|
use 5.008001; |
|
7
|
|
|
|
|
27
|
|
3
|
7
|
|
|
7
|
|
32
|
use strict; |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
158
|
|
4
|
7
|
|
|
7
|
|
31
|
use warnings; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
353
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.03"; |
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
1773
|
use DBI; |
|
7
|
|
|
|
|
14749
|
|
|
7
|
|
|
|
|
1294
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $drh = undef; |
11
|
|
|
|
|
|
|
our $err = ''; |
12
|
|
|
|
|
|
|
our $errstr = ''; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub driver { |
15
|
6
|
|
|
6
|
0
|
739
|
my ($class, $attr) = @_; |
16
|
6
|
|
33
|
|
|
64
|
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
|
7
|
|
|
7
|
|
37
|
use strict; |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
145
|
|
31
|
7
|
|
|
7
|
|
26
|
use warnings; |
|
7
|
|
|
|
|
24
|
|
|
7
|
|
|
|
|
729
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
our $imp_data_size = 0; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub connect { |
36
|
6
|
50
|
|
6
|
|
813
|
my $dbh = shift->SUPER::connect(@_) |
37
|
|
|
|
|
|
|
or return; |
38
|
6
|
|
|
|
|
361
|
$dbh->STORE(Active => 1); |
39
|
6
|
|
|
|
|
20
|
return $dbh; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
0
|
|
0
|
sub data_sources { qw/dbi:BlackHole:/ } |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
package DBD::BlackHole::db; |
45
|
7
|
|
|
7
|
|
30
|
use strict; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
126
|
|
46
|
7
|
|
|
7
|
|
24
|
use warnings; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
202
|
|
47
|
|
|
|
|
|
|
|
48
|
7
|
|
|
7
|
|
27
|
use Carp qw/croak/; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
406
|
|
49
|
|
|
|
|
|
|
|
50
|
7
|
|
|
7
|
|
30
|
use constant DEFAULT_IDENTIFIER => '`'; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
2606
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
our $imp_data_size = 0; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub get_info { |
55
|
3
|
|
|
3
|
|
499
|
my ($dbh, $type) = @_; |
56
|
|
|
|
|
|
|
# identifier quote |
57
|
3
|
100
|
50
|
|
|
10
|
return $dbh->FETCH('blackhole_identifier') || DEFAULT_IDENTIFIER if $type == 29; |
58
|
2
|
|
|
|
|
5
|
return; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub prepare { |
62
|
14
|
|
|
14
|
|
5675
|
my ($dbh, $statement) = @_; |
63
|
|
|
|
|
|
|
|
64
|
14
|
|
|
|
|
65
|
my $sth = DBI::_new_sth($dbh, { |
65
|
|
|
|
|
|
|
Statement => $statement, |
66
|
|
|
|
|
|
|
NAME => ['dummy'], |
67
|
|
|
|
|
|
|
NUM_OF_FIELDS => -1, |
68
|
|
|
|
|
|
|
}); |
69
|
|
|
|
|
|
|
|
70
|
14
|
|
|
|
|
331
|
return $sth; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
2
|
|
|
2
|
|
276
|
sub ping { shift->FETCH('Active') } |
74
|
|
|
|
|
|
|
|
75
|
7
|
|
|
7
|
|
29
|
sub disconnect { shift->STORE(Active => 0) } |
76
|
|
|
|
|
|
|
|
77
|
2
|
|
|
2
|
|
16
|
sub begin_work { 1 } |
78
|
1
|
|
|
1
|
|
5
|
sub commit { 1 } |
79
|
1
|
|
|
1
|
|
4
|
sub rollback { 1 } |
80
|
|
|
|
0
|
|
|
sub tables {} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub FETCH { |
83
|
5
|
|
|
5
|
|
477
|
my $dbh = shift; |
84
|
5
|
|
|
|
|
18
|
my $key = shift; |
85
|
5
|
50
|
|
|
|
16
|
return 1 if $key eq 'AutoCommit'; |
86
|
5
|
|
|
|
|
82
|
return $dbh->SUPER::FETCH($key); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
sub STORE { |
90
|
38
|
|
|
38
|
|
391
|
my $dbh = shift; |
91
|
38
|
|
|
|
|
51
|
my ($key, $value) = @_; |
92
|
|
|
|
|
|
|
|
93
|
38
|
100
|
|
|
|
89
|
if ($key eq 'AutoCommit') { |
94
|
6
|
50
|
33
|
|
|
21
|
croak 'Cannot disable AutoCommit' if !$value && $dbh->FETCH('AutoCommit'); |
95
|
6
|
|
|
|
|
20
|
return $value; |
96
|
|
|
|
|
|
|
} |
97
|
32
|
|
|
|
|
592
|
return $dbh->SUPER::STORE($key, $value); |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
6
|
|
|
6
|
|
6777
|
sub DESTROY { shift->disconnect } |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
package DBD::BlackHole::st; |
103
|
7
|
|
|
7
|
|
32
|
use strict; |
|
7
|
|
|
|
|
9
|
|
|
7
|
|
|
|
|
125
|
|
104
|
7
|
|
|
7
|
|
21
|
use warnings; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
878
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
our $imp_data_size = 0; |
107
|
|
|
|
|
|
|
|
108
|
3
|
|
|
3
|
|
101
|
sub bind_col { 1 } |
109
|
0
|
|
|
0
|
|
0
|
sub bind_param { 1 } |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub execute { |
112
|
14
|
|
|
14
|
|
4139
|
my $sth = shift; |
113
|
14
|
|
|
|
|
87
|
$sth->STORE(NUM_OF_FIELDS => 1); |
114
|
14
|
|
|
|
|
40
|
$sth->STORE(NUM_OF_PARAMS => 0); |
115
|
14
|
|
|
|
|
33
|
1; |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
|
118
|
5
|
|
|
5
|
|
2352
|
sub rows { 0 } |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
15
|
|
|
sub fetch {} |
121
|
|
|
|
|
|
|
|
122
|
1
|
|
|
1
|
|
13
|
sub fetchall_hashref { +{} } |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
1; |
125
|
|
|
|
|
|
|
__END__ |