line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBD::Simulated::db; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
DBD::Simulated::db - Database part for DBD::Simulated |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 SYNOPSIS |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Do not use this directly without DBI. See L for more information about using a DBD module. |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 DESCRIPTION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
see L. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
=cut |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
28
|
use 5.010; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
145
|
|
20
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
21
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
435
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
$DBD::Simulated::db::imp_data_size = 0; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub prepare { |
28
|
0
|
|
|
0
|
0
|
|
my ($dbh, $statement, @attribs) = @_; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# create a 'blank' sth |
31
|
0
|
|
|
|
|
|
my ($outer, $sth) = DBI::_new_sth($dbh, {Statement => $statement}); |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
return $dbh->set_err($1, "Simulated prepare error $1") |
34
|
|
|
|
|
|
|
if $statement =~ /simulated_prepare_error=(\d+)/; |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$sth->{statement} = $statement; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return $outer; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub STORE { |
42
|
0
|
|
|
0
|
|
|
my ($dbh, $attr, $val) = @_; |
43
|
0
|
0
|
|
|
|
|
if ($attr eq 'AutoCommit') { |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# AutoCommit is currently the only standard attribute we have |
46
|
|
|
|
|
|
|
# to consider. |
47
|
0
|
0
|
|
|
|
|
if (!$val) {die "Can't disable AutoCommit";} |
|
0
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
return 1; |
49
|
|
|
|
|
|
|
} |
50
|
0
|
|
|
|
|
|
$dbh->SUPER::STORE($attr, $val); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub FETCH { |
54
|
0
|
|
|
0
|
|
|
my ($dbh, $attr) = @_; |
55
|
0
|
0
|
|
|
|
|
if ($attr eq 'AutoCommit') {return 1;} |
|
0
|
|
|
|
|
|
|
56
|
0
|
|
|
|
|
|
$dbh->SUPER::FETCH($attr); |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=pod |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 SUPPORT |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
No support is available |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Copyright 2012 Sebastian Willing, eGENTIC Systems L |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |