| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
2
|
|
|
2
|
|
3808
|
use 5.008001; |
|
|
2
|
|
|
|
|
7
|
|
|
|
2
|
|
|
|
|
87
|
|
|
2
|
2
|
|
|
2
|
|
12
|
use utf8; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
14
|
|
|
3
|
2
|
|
|
2
|
|
116
|
use strict; |
|
|
2
|
|
|
|
|
11
|
|
|
|
2
|
|
|
|
|
91
|
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings FATAL => 'all'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
158
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
########################################################################### |
|
7
|
|
|
|
|
|
|
########################################################################### |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
{ package Muldis::DB::Interface; # module |
|
10
|
|
|
|
|
|
|
our $VERSION = 0.004000; |
|
11
|
|
|
|
|
|
|
# Note: This given version applies to all of this file's packages. |
|
12
|
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
11
|
use Carp; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
237
|
|
|
14
|
2
|
|
|
2
|
|
2418
|
use Encode qw(is_utf8); |
|
|
2
|
|
|
|
|
38284
|
|
|
|
2
|
|
|
|
|
236
|
|
|
15
|
2
|
|
|
2
|
|
24
|
use Scalar::Util qw(blessed); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
450
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
########################################################################### |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new_dbms { |
|
20
|
|
|
|
|
|
|
my ($args) = @_; |
|
21
|
|
|
|
|
|
|
my ($engine_name, $dbms_config) |
|
22
|
|
|
|
|
|
|
= @{$args}{'engine_name', 'dbms_config'}; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
confess q{new_dbms(): Bad :$engine_name arg; Perl 5 does not consider} |
|
25
|
|
|
|
|
|
|
. q{ it to be a character string, or it is the empty string.} |
|
26
|
|
|
|
|
|
|
if !defined $engine_name or $engine_name eq q{} |
|
27
|
|
|
|
|
|
|
or (!is_utf8 $engine_name |
|
28
|
|
|
|
|
|
|
and $engine_name =~ m/[^\x00-\x7F]/xs); |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# A module may be loaded due to it being embedded in a non-excl file. |
|
31
|
|
|
|
|
|
|
if (!do { |
|
32
|
2
|
|
|
2
|
|
13
|
no strict 'refs'; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
3655
|
|
|
33
|
|
|
|
|
|
|
defined %{$engine_name . '::'}; |
|
34
|
|
|
|
|
|
|
}) { |
|
35
|
|
|
|
|
|
|
# Note: We have to invoke this 'require' in an eval string |
|
36
|
|
|
|
|
|
|
# because we need the bareword semantics, where 'require' |
|
37
|
|
|
|
|
|
|
# will munge the module name into file system paths. |
|
38
|
|
|
|
|
|
|
eval "require $engine_name;"; |
|
39
|
|
|
|
|
|
|
if (my $err = $@) { |
|
40
|
|
|
|
|
|
|
confess q{new_dbms(): Could not load Muldis DB Engine module} |
|
41
|
|
|
|
|
|
|
. qq{ '$engine_name': $err}; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
confess qq{new_dbms(): Could not load Muldis DB Engine module} |
|
44
|
|
|
|
|
|
|
. qq{ '$engine_name': while that file did compile without} |
|
45
|
|
|
|
|
|
|
. q{ errors, it did not declare the same-named module.} |
|
46
|
|
|
|
|
|
|
if !do { |
|
47
|
|
|
|
|
|
|
no strict 'refs'; |
|
48
|
|
|
|
|
|
|
defined %{$engine_name . '::'}; |
|
49
|
|
|
|
|
|
|
}; |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
confess qq{new_dbms(): The Muldis DB Engine module '$engine_name' does} |
|
52
|
|
|
|
|
|
|
. q{ not provide the new_dbms() constructor function.} |
|
53
|
|
|
|
|
|
|
if !$engine_name->can( 'new_dbms' ); |
|
54
|
|
|
|
|
|
|
my $dbms = eval { |
|
55
|
|
|
|
|
|
|
&{$engine_name->can( 'new_dbms' )}({ |
|
56
|
|
|
|
|
|
|
'dbms_config' => $dbms_config }); |
|
57
|
|
|
|
|
|
|
}; |
|
58
|
|
|
|
|
|
|
if (my $err = $@) { |
|
59
|
|
|
|
|
|
|
confess qq{new_dbms(): The Muldis DB Engine module '$engine_name'} |
|
60
|
|
|
|
|
|
|
. qq{ threw an exception during its new_dbms() exec: $err}; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
confess q{new_dbms(): The new_dbms() constructor function of the} |
|
63
|
|
|
|
|
|
|
. qq{ Muldis DB Engine module '$engine_name' did not return an} |
|
64
|
|
|
|
|
|
|
. q{ object of a Muldis::DB::Interface::DBMS-doing class.} |
|
65
|
|
|
|
|
|
|
if !blessed $dbms or !$dbms->isa( 'Muldis::DB::Interface::DBMS' ); |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
return $dbms; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
########################################################################### |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
} # module Muldis::DB::Interface |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
########################################################################### |
|
75
|
|
|
|
|
|
|
########################################################################### |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
{ package Muldis::DB::Interface::DBMS; # role |
|
78
|
|
|
|
|
|
|
use Carp; |
|
79
|
|
|
|
|
|
|
use Scalar::Util qw(blessed); |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub new_var { |
|
82
|
|
|
|
|
|
|
my ($self) = @_; |
|
83
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
sub assoc_vars { |
|
87
|
|
|
|
|
|
|
my ($self) = @_; |
|
88
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
89
|
|
|
|
|
|
|
} |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
sub new_func_binding { |
|
92
|
|
|
|
|
|
|
my ($self) = @_; |
|
93
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
sub assoc_func_bindings { |
|
97
|
|
|
|
|
|
|
my ($self) = @_; |
|
98
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub new_proc_binding { |
|
102
|
|
|
|
|
|
|
my ($self) = @_; |
|
103
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
sub assoc_proc_bindings { |
|
107
|
|
|
|
|
|
|
my ($self) = @_; |
|
108
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
109
|
|
|
|
|
|
|
} |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
sub call_func { |
|
112
|
|
|
|
|
|
|
my ($self) = @_; |
|
113
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
114
|
|
|
|
|
|
|
} |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub call_proc { |
|
117
|
|
|
|
|
|
|
my ($self) = @_; |
|
118
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
119
|
|
|
|
|
|
|
} |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
sub trans_nest_level { |
|
122
|
|
|
|
|
|
|
my ($self) = @_; |
|
123
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
124
|
|
|
|
|
|
|
} |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
sub start_trans { |
|
127
|
|
|
|
|
|
|
my ($self) = @_; |
|
128
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
129
|
|
|
|
|
|
|
} |
|
130
|
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub commit_trans { |
|
132
|
|
|
|
|
|
|
my ($self) = @_; |
|
133
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
134
|
|
|
|
|
|
|
} |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
sub rollback_trans { |
|
137
|
|
|
|
|
|
|
my ($self) = @_; |
|
138
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
139
|
|
|
|
|
|
|
} |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
} # role Muldis::DB::Interface::DBMS |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
########################################################################### |
|
144
|
|
|
|
|
|
|
########################################################################### |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
{ package Muldis::DB::Interface::Var; # role |
|
147
|
|
|
|
|
|
|
use Carp; |
|
148
|
|
|
|
|
|
|
use Scalar::Util qw(blessed); |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
sub assoc_dbms { |
|
151
|
|
|
|
|
|
|
my ($self) = @_; |
|
152
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
153
|
|
|
|
|
|
|
} |
|
154
|
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
sub decl_type { |
|
156
|
|
|
|
|
|
|
my ($self) = @_; |
|
157
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
158
|
|
|
|
|
|
|
} |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
sub fetch_ast { |
|
161
|
|
|
|
|
|
|
my ($self) = @_; |
|
162
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
163
|
|
|
|
|
|
|
} |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
sub store_ast { |
|
166
|
|
|
|
|
|
|
my ($self) = @_; |
|
167
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
168
|
|
|
|
|
|
|
} |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
} # role Muldis::DB::Interface::Var |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
########################################################################### |
|
173
|
|
|
|
|
|
|
########################################################################### |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
{ package Muldis::DB::Interface::FuncBinding; # role |
|
176
|
|
|
|
|
|
|
use Carp; |
|
177
|
|
|
|
|
|
|
use Scalar::Util qw(blessed); |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
sub assoc_dbms { |
|
180
|
|
|
|
|
|
|
my ($self) = @_; |
|
181
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
182
|
|
|
|
|
|
|
} |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
sub bind_func { |
|
185
|
|
|
|
|
|
|
my ($self) = @_; |
|
186
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
187
|
|
|
|
|
|
|
} |
|
188
|
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
sub bound_func { |
|
190
|
|
|
|
|
|
|
my ($self) = @_; |
|
191
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
192
|
|
|
|
|
|
|
} |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
sub bind_result { |
|
195
|
|
|
|
|
|
|
my ($self) = @_; |
|
196
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
197
|
|
|
|
|
|
|
} |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
sub bound_result { |
|
200
|
|
|
|
|
|
|
my ($self) = @_; |
|
201
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
202
|
|
|
|
|
|
|
} |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
sub bind_params { |
|
205
|
|
|
|
|
|
|
my ($self) = @_; |
|
206
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
207
|
|
|
|
|
|
|
} |
|
208
|
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
sub bound_params { |
|
210
|
|
|
|
|
|
|
my ($self) = @_; |
|
211
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
212
|
|
|
|
|
|
|
} |
|
213
|
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
sub call { |
|
215
|
|
|
|
|
|
|
my ($self) = @_; |
|
216
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
} # role Muldis::DB::Interface::FuncBinding |
|
220
|
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
########################################################################### |
|
222
|
|
|
|
|
|
|
########################################################################### |
|
223
|
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
{ package Muldis::DB::Interface::ProcBinding; # role |
|
225
|
|
|
|
|
|
|
use Carp; |
|
226
|
|
|
|
|
|
|
use Scalar::Util qw(blessed); |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
sub assoc_dbms { |
|
229
|
|
|
|
|
|
|
my ($self) = @_; |
|
230
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
231
|
|
|
|
|
|
|
} |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
sub bind_proc { |
|
234
|
|
|
|
|
|
|
my ($self) = @_; |
|
235
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
236
|
|
|
|
|
|
|
} |
|
237
|
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
sub bound_proc { |
|
239
|
|
|
|
|
|
|
my ($self) = @_; |
|
240
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
241
|
|
|
|
|
|
|
} |
|
242
|
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
sub bind_upd_params { |
|
244
|
|
|
|
|
|
|
my ($self) = @_; |
|
245
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
246
|
|
|
|
|
|
|
} |
|
247
|
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
sub bound_upd_params { |
|
249
|
|
|
|
|
|
|
my ($self) = @_; |
|
250
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
251
|
|
|
|
|
|
|
} |
|
252
|
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub bind_ro_params { |
|
254
|
|
|
|
|
|
|
my ($self) = @_; |
|
255
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
256
|
|
|
|
|
|
|
} |
|
257
|
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
sub bound_ro_params { |
|
259
|
|
|
|
|
|
|
my ($self) = @_; |
|
260
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
261
|
|
|
|
|
|
|
} |
|
262
|
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
sub call { |
|
264
|
|
|
|
|
|
|
my ($self) = @_; |
|
265
|
|
|
|
|
|
|
confess q{not implemented by subclass } . (blessed $self); |
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
} # role Muldis::DB::Interface::ProcBinding |
|
269
|
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
########################################################################### |
|
271
|
|
|
|
|
|
|
########################################################################### |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
1; # Magic true value required at end of a reusable file's code. |
|
274
|
|
|
|
|
|
|
__END__ |