| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Apache::Session::Browseable::Store::DBI; |
|
2
|
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
445334
|
use strict; |
|
|
4
|
|
|
|
|
9
|
|
|
|
4
|
|
|
|
|
178
|
|
|
4
|
4
|
|
|
4
|
|
594
|
use Apache::Session::Store::DBI; |
|
|
4
|
|
|
|
|
1054
|
|
|
|
4
|
|
|
|
|
3175
|
|
|
5
|
|
|
|
|
|
|
our @ISA = qw(Apache::Session::Store::DBI); |
|
6
|
|
|
|
|
|
|
our $VERSION = 1.3.11; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub insert { |
|
9
|
29
|
|
|
29
|
0
|
1557
|
my ( $self, $session ) = @_; |
|
10
|
|
|
|
|
|
|
|
|
11
|
29
|
|
|
|
|
195
|
$self->connection($session); |
|
12
|
|
|
|
|
|
|
|
|
13
|
29
|
|
|
|
|
354
|
local $self->{dbh}->{RaiseError} = 1; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $index = |
|
16
|
|
|
|
|
|
|
ref( $session->{args}->{Index} ) |
|
17
|
|
|
|
|
|
|
? $session->{args}->{Index} |
|
18
|
29
|
50
|
|
|
|
712
|
: [ split /\s+/, $session->{args}->{Index} ]; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$self->{insert_sth} //= |
|
21
|
|
|
|
|
|
|
$self->{dbh}->prepare_cached( "INSERT INTO $self->{table_name} (" |
|
22
|
29
|
|
33
|
|
|
280
|
. join( ',', 'id', 'a_session', map { s/'/''/g; $_ } @$index ) |
|
|
56
|
|
|
|
|
173
|
|
|
|
56
|
|
|
|
|
447
|
|
|
23
|
|
|
|
|
|
|
. ') VALUES (' |
|
24
|
|
|
|
|
|
|
. join( ',', ('?') x ( 2 + @$index ) ) |
|
25
|
|
|
|
|
|
|
. ')' ); |
|
26
|
|
|
|
|
|
|
|
|
27
|
29
|
|
|
|
|
4075
|
$self->{insert_sth}->bind_param( 1, $session->{data}->{_session_id} ); |
|
28
|
29
|
|
|
|
|
156
|
$self->{insert_sth}->bind_param( 2, $session->{serialized} ); |
|
29
|
29
|
|
|
|
|
384
|
my $i = 3; |
|
30
|
29
|
|
|
|
|
95
|
foreach my $f (@$index) { |
|
31
|
56
|
|
|
|
|
329
|
$self->{insert_sth}->bind_param( $i, $session->{data}->{$f} ); |
|
32
|
56
|
|
|
|
|
148
|
$i++; |
|
33
|
|
|
|
|
|
|
} |
|
34
|
|
|
|
|
|
|
|
|
35
|
29
|
|
|
|
|
14769
|
$self->{insert_sth}->execute; |
|
36
|
|
|
|
|
|
|
|
|
37
|
29
|
|
|
|
|
682
|
$self->{insert_sth}->finish; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub update { |
|
41
|
29
|
|
|
29
|
0
|
1191
|
my $self = shift; |
|
42
|
29
|
|
|
|
|
72
|
my $session = shift; |
|
43
|
|
|
|
|
|
|
|
|
44
|
29
|
|
|
|
|
173
|
$self->connection($session); |
|
45
|
|
|
|
|
|
|
|
|
46
|
29
|
|
|
|
|
291
|
local $self->{dbh}->{RaiseError} = 1; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $index = |
|
49
|
|
|
|
|
|
|
ref( $session->{args}->{Index} ) |
|
50
|
|
|
|
|
|
|
? $session->{args}->{Index} |
|
51
|
29
|
50
|
|
|
|
668
|
: [ split /\s+/, $session->{args}->{Index} ]; |
|
52
|
|
|
|
|
|
|
|
|
53
|
29
|
50
|
|
|
|
121
|
if ( !defined $self->{update_sth} ) { |
|
54
|
|
|
|
|
|
|
$self->{update_sth} = |
|
55
|
29
|
|
|
|
|
287
|
$self->{dbh}->prepare_cached( "UPDATE $self->{table_name} SET " |
|
56
|
|
|
|
|
|
|
. join( ' = ?, ', 'a_session', @$index ) |
|
57
|
|
|
|
|
|
|
. ' = ? WHERE id = ?' ); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
29
|
|
|
|
|
6816
|
$self->{update_sth}->bind_param( 1, $session->{serialized} ); |
|
61
|
29
|
|
|
|
|
71
|
my $i = 2; |
|
62
|
29
|
|
|
|
|
100
|
foreach my $f (@$index) { |
|
63
|
56
|
|
|
|
|
334
|
$self->{update_sth}->bind_param( $i, $session->{data}->{$f} ); |
|
64
|
56
|
|
|
|
|
121
|
$i++; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
29
|
|
|
|
|
135
|
$self->{update_sth}->bind_param( $i, $session->{data}->{_session_id} ); |
|
67
|
|
|
|
|
|
|
|
|
68
|
29
|
|
|
|
|
998
|
$self->{update_sth}->execute; |
|
69
|
|
|
|
|
|
|
|
|
70
|
29
|
|
|
|
|
383
|
$self->{update_sth}->finish; |
|
71
|
|
|
|
|
|
|
} |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
1; |