| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# -*-perl-*- |
|
2
|
|
|
|
|
|
|
# Creation date: 2003-03-30 15:24:44 |
|
3
|
|
|
|
|
|
|
# Authors: Don |
|
4
|
|
|
|
|
|
|
# Change log: |
|
5
|
|
|
|
|
|
|
# $Revision: 1963 $ |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# Copyright (c) 2003-2012 Don Owens |
|
8
|
|
|
|
|
|
|
# |
|
9
|
|
|
|
|
|
|
# All rights reserved. This program is free software; you can |
|
10
|
|
|
|
|
|
|
# redistribute it and/or modify it under the same terms as Perl |
|
11
|
|
|
|
|
|
|
# itself. |
|
12
|
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
11
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
100
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
{ package DBIx::Wrapper::StatementLoop; |
|
16
|
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
|
10
|
use vars qw($VERSION); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
205
|
|
|
18
|
|
|
|
|
|
|
$VERSION = do { my @r=(q$Revision: 1963 $=~/\d+/g); sprintf "%d."."%02d"x$#r,@r }; |
|
19
|
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
11
|
use base 'DBIx::Wrapper::Statement'; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
970
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
|
23
|
0
|
|
|
0
|
0
|
|
my ($proto, $parent, $query) = @_; |
|
24
|
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
my $r = DBIx::Wrapper::Request->new($parent); |
|
26
|
0
|
|
|
|
|
|
$r->setQuery($query); |
|
27
|
|
|
|
|
|
|
|
|
28
|
0
|
|
|
|
|
|
$parent->_runPrePrepareHook($r); |
|
29
|
0
|
|
|
|
|
|
$query = $r->getQuery; |
|
30
|
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
my $sth = $parent->_getDatabaseHandle()->prepare($query); |
|
32
|
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
$r->setStatementHandle($sth); |
|
34
|
0
|
|
|
|
|
|
$parent->_runPostPrepareHook($r); |
|
35
|
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
$r->setStatementHandle($sth); |
|
37
|
0
|
0
|
|
|
|
|
unless ($sth) { |
|
38
|
0
|
|
|
|
|
|
$parent->_printDbiError("\nQuery was '$query'\n"); |
|
39
|
0
|
|
|
|
|
|
return $parent->setErr(0, $DBI::errstr); |
|
40
|
|
|
|
|
|
|
} |
|
41
|
|
|
|
|
|
|
|
|
42
|
0
|
|
0
|
|
|
|
my $self = bless {}, ref($proto) || $proto; |
|
43
|
0
|
|
|
|
|
|
$self->_setSth($sth); |
|
44
|
0
|
|
|
|
|
|
$self->_setParent($parent); |
|
45
|
0
|
|
|
|
|
|
$self->_setQuery($query); |
|
46
|
0
|
|
|
|
|
|
$self->_setRequestObj($r); |
|
47
|
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
|
return $self; |
|
49
|
|
|
|
|
|
|
} |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub next { |
|
52
|
0
|
|
|
0
|
0
|
|
my ($self, $exec_args) = @_; |
|
53
|
0
|
0
|
|
|
|
|
if (scalar(@_) == 3) { |
|
54
|
0
|
0
|
|
|
|
|
$exec_args = [ $exec_args ] unless ref($exec_args); |
|
55
|
|
|
|
|
|
|
} |
|
56
|
0
|
0
|
|
|
|
|
$exec_args = [] unless $exec_args; |
|
57
|
|
|
|
|
|
|
|
|
58
|
0
|
|
|
|
|
|
my $r = $self->_getRequestObj; |
|
59
|
0
|
|
|
|
|
|
$r->setExecArgs($exec_args); |
|
60
|
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $sth = $self->_getSth; |
|
62
|
|
|
|
|
|
|
|
|
63
|
0
|
|
|
|
|
|
$self->_getParent()->_runPreExecHook($r); |
|
64
|
0
|
|
|
|
|
|
$exec_args = $r->getExecArgs; |
|
65
|
|
|
|
|
|
|
|
|
66
|
0
|
|
|
|
|
|
my $rv = $sth->execute(@$exec_args); |
|
67
|
|
|
|
|
|
|
|
|
68
|
0
|
|
|
|
|
|
$r->setExecReturnValue($rv); |
|
69
|
|
|
|
|
|
|
|
|
70
|
0
|
|
|
|
|
|
$self->_getParent()->_runPostExecHook($r); |
|
71
|
|
|
|
|
|
|
|
|
72
|
0
|
|
|
|
|
|
return $rv; |
|
73
|
|
|
|
|
|
|
} |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub DESTROY { |
|
76
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
|
77
|
0
|
|
|
|
|
|
my $sth = $self->_getSth; |
|
78
|
0
|
0
|
|
|
|
|
$sth->finish if $sth; |
|
79
|
|
|
|
|
|
|
} |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |
|
84
|
|
|
|
|
|
|
|