lib/DB/Object/Mysql/Statement.pm

filter: Statementstmt 16.4% 22 / 134 Branchbran 0.0% 0 / 68 Conditioncond 0.0% 0 / 36 MC/DCmcdc 0.0% 0 / 20 Subroutinesub 50.0% 7 / 14 Podpod 100% 6 / 6 totaltotal 12.5% 35 / 278 CC 53 SCAR 54.0
CC
53
Cov
9%
dump
506.0
priority
156.0
ignore
90.0
CRAP 221.3
« lib/DB/Object/Query/Clause.pm ↑ Summary blib/lib/DB/Object/Mysql/Query.pm »
1 # -*- perl -*-
2 ##----------------------------------------------------------------------------
3 ## SQL API Abstraction - ~/lib/DB/Object/Mysql/Statement.pm
4 ## Version v0.300.3
5 ## Copyright(c) 2024 DEGUEST Pte. Ltd.
6 ## Author: Jacques Deguest <jack@deguest.jp>
7 ## Created 2017/07/19
8 ## Modified 2026/10/01
9 ## All rights reserved
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 # This package's purpose is to automatically terminate the statement object and
15 # separate them from the connection object (DB::Object).
16 # Connection object last longer than statement objects
17 #------------------------------------------------------------------------------
18 package DB::Object::Mysql::Statement;
19 BEGIN
20 1 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 warnings::register_categories( 'DB::Object' );
24 1 ▶ use parent qw( DB::Object::Statement );
Subroutine BEGIN: called CC=1 SCAR=0.0
25 1 ▶ use vars qw( $VERSION $DEBUG );
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 our $DEBUG = 0;
27 1 our $VERSION = 'v0.300.3';
28 };
29  
30 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
31 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 # Inherited from DB::Object::Statement
34 # sub bind_param
35  
36 # sub commit is called by dbh, so it is in DB::Object::Postgres
37  
38 # Customised for MySQL
39 sub distinct
40 0 ▶{
Subroutine distinct: not called CC=7 SCAR=40.3
Pod documented
41 0 my $self = shift( @_ );
42 my $query = $self->{query} ||
43 0 ▶ return( $self->error( "No query to set as to be ignored." ) );
Condition0%0/2
$self->{'query'} || (return $self->error('No query to set as to be ignored.'))
l!l
00
MC/DC0%0/1
$self->{'query'} || (return $self->error('No query to set as to be ignored.'))
$self->{'query'}
Truth table0%0/2
A
A= $self->{'query'}
Aresult
11
00
44  
45 0 my $type = uc( ( $query =~ /^\s*(\S+)\s+/ )[ 0 ] );
46 # ALTER for table alteration statements (DB::Object::Tables
47 0 my @allowed = qw( SELECT );
48 0 my $allowed = CORE::join( '|', @allowed );
49 0 ▶ if( !scalar( grep{ /^$type$/i } @allowed ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (scalar grep({/^$type$/i;} @allowed)) 0 0 0
50 {
51 0 return( $self->error( "You may not flag statement of type \U$type\E to be distinct:\n$query" ) );
52 }
53 # Incompatible. Do not bother going further
54 0 ▶ return( $self ) if( $query =~ /^[[:blank:]]*(?:$allowed)[[:blank:]]+(?:DISTINCT|DISTINCTROW|ALL)[[:blank:]]+/i );
Branch: 1 branch
BranchTrueFalseTotal
if $query =~ /^[[:blank:]]*(?:$allowed)[[:blank:]]+(?:DISTINCT|DISTINCTROW|ALL)[[:blank:]]+/i 0 0 0
55  
56 0 $query =~ s/^([[:blank:]]*)($allowed)([[:blank:]]+)/$1$2 DISTINCT /;
57 0 ▶ my $sth = $self->_cache_this( $query ) ||
Condition0%0/2
$self->_cache_this($query) || (return $self->error("Error while preparing new ignored query:\n$query"))
l!l
00
MC/DC0%0/1
$self->_cache_this($query) || (return $self->error("Error while preparing new ignored query:\n$query"))
$self->_cache_this($query)
Truth table0%0/2
A
A= $self->_cache_this($query)
Aresult
11
00
58 return( $self->error( "Error while preparing new ignored query:\n$query" ) );
59 0 ▶ if( !defined( wantarray() ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined wantarray) 0 0 0
60 {
61 0 ▶ $sth->execute() ||
Branch: 1 branch
BranchTrueFalseTotal
$sth->execute or return $self->error("Error while executing new ignored query:\n$query") 0 0 0
62 return( $self->error( "Error while executing new ignored query:\n$query" ) );
63 }
64 0 return( $sth );
65 }
66  
67 # Customised for MySQL
68 sub dump
69 0 ▶{
Subroutine dump: not called CC=22 SCAR=62.3
Pod documented
70 0 my $self = shift( @_ );
71 0 ▶ my $args = @_ == 1 ? shift( @_ ) : { @_ };
Branch: 1 branch
BranchTrueFalseTotal
@_ == 1 ? : 0 0 0
72 0 my $vsep = ",";
73 0 my $hsep = "\n";
74 0 my $width = 35;
75 0 ▶ $self->_load_class( 'DateTime::Lite' ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->_load_class("DateTime::Lite") or return $self->pass_error 0 0 0
76 0 ▶ $self->_load_class( 'Module::Generic::File' ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->_load_class("Module::Generic::File") or return $self->pass_error 0 0 0
77 0 ▶ my $fh = Module::Generic::File->stdout() ||
Condition0%0/2
'Module::Generic::File'->stdout || (return $self->pass_error('Module::Generic::File'->error))
l!l
00
MC/DC0%0/1
'Module::Generic::File'->stdout || (return $self->pass_error('Module::Generic::File'->error))
'Module::Generic::File'->stdout
Truth table0%0/2
A
A= 'Module::Generic::File'->stdout
Aresult
11
00
78 return( $self->pass_error( Module::Generic::File->error ) );
79 0 ▶ $vsep = $args->{vsep} if( exists( $args->{vsep} ) );
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{"vsep"} 0 0 0
80 0 ▶ $hsep = $args->{hsep} if( exists( $args->{hsep} ) );
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{"hsep"} 0 0 0
81 0 ▶ $width = $args->{width} if( exists( $args->{width} ) );
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{"width"} 0 0 0
82 0 my @fields = ();
83 # my @fields = @{$self->{sth}->FETCH( 'NAME' )};
84 0 my $fields_ref = $self->{sth}->{NAME};
85 0 ▶ if( defined( $fields_ref ) && ref( $fields_ref ) eq 'ARRAY' )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $fields_ref and ref $fields_ref eq 'ARRAY') { } 0 0 0
Condition0%0/3
defined $fields_ref and ref $fields_ref eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $fields_ref and ref $fields_ref eq "ARRAY"
defined $fields_ref ref $fields_ref eq "ARRAY"
Truth table0%0/3
A and B
A= defined $fields_refB= ref $fields_ref eq "ARRAY"
ABresult
0X0
100
111
86 {
87 0 @fields = @$fields_ref;
88 }
89 else
90 {
91 0 return( $self->error( "No array reference of fields could be retrieved from statement '$self->{sth}'." ) );
92 }
93 0 ▶ return( $self->error( "No query to dump." ) ) if( !exists( $self->{sth} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $self->{"sth"} 0 0 0
94 0 ▶ if( exists( $args->{file} ) )
Branch: 2 branches
BranchTrueFalseTotal
if (exists $args->{'file'}) { } 0 0 0
elsif (exists $args->{'fh'}) { } 0 0 0
95 {
96 # new_file is inherited from Module::Generic and uses Module::Generic::File
97 0 ▶ my $file = $self->new_file( $args->{file} ) || return( $self->pass_error );
Condition0%0/2
$self->new_file($args->{'file'}) || (return $self->pass_error)
l!l
00
MC/DC0%0/1
$self->new_file($args->{'file'}) || (return $self->pass_error)
$self->new_file($args->{'file'})
Truth table0%0/2
A
A= $self->new_file($args->{'file'})
Aresult
11
00
98 0 ▶ $fh = $file->open( '>', { binmode => 'utf8' }) || return( $self->error( "Unable to open file $file in write mode: $!" ) );
Condition0%0/2
$file->open('>', {'binmode', 'utf8'}) || (return $self->error("Unable to open file $file in write mode: $!"))
l!l
00
MC/DC0%0/1
$file->open('>', {'binmode', 'utf8'}) || (return $self->error("Unable to open file $file in write mode: $!"))
$file->open('>', {'binmode', 'utf8'})
Truth table0%0/2
A
A= $file->open('>', {'binmode', 'utf8'})
Aresult
11
00
99 0 my @header = sort{ $a <=> $b } @fields;
100 0 my $date = DateTime::Lite->now;
101 0 my $table = $self->{table};
102 0 $fh->printf( "# Generated on %s for table $table\n", $date->strftime( '%c' ) );
103 0 $fh->print( "# ", CORE::join( "\t", @header ), "\n" );
104 0 my @data = ();
105 0 ▶ while( @data = $self->fetchrow() )
Branch: 1 branch
BranchTrueFalseTotal
if (@data = $self->fetchrow) 0 0 0
106 {
107 0 $fh->print( CORE::join( "\t", @data ), "\n" );
108 }
109 0 $fh->close();
110 0 $self->finish();
111 0 return( $self );
112 }
113 elsif( exists( $args->{fh} ) )
114 {
115 0 ▶ if( !fileno( $args->{fh} ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (fileno $args->{"fh"}) 0 0 0
116 {
117 0 return( $self->error( "The file descriptor provided does not seem to be valid (not open)" ) );
118 }
119 0 ▶ $fh = IO::File->new_from_fd( $args->{fh}, 'w' ) || return( $self->error( $! ) );
Condition0%0/2
'IO::File'->new_from_fd($args->{'fh'}, 'w') || (return $self->error($!))
l!l
00
MC/DC0%0/1
'IO::File'->new_from_fd($args->{'fh'}, 'w') || (return $self->error($!))
'IO::File'->new_from_fd($args->{'fh'}, 'w')
Truth table0%0/2
A
A= 'IO::File'->new_from_fd($args->{'fh'}, 'w')
Aresult
11
00
120 }
121 0 my $max = 0;
122 # foreach my $field ( keys( %$fields ) )
123 0 foreach my $field ( @fields )
124 {
125 0 ▶ $max = length( $field ) if( length( $field ) > $max );
Branch: 1 branch
BranchTrueFalseTotal
if length $field > $max 0 0 0
126 }
127 0 my $template = '';
128 # foreach my $field ( sort{ $fields->{ $a } <=> $fields->{ $b } } keys( %$fields ) )
129 0 foreach my $field ( @fields )
130 {
131 0 $template .= "$field" . ( '.' x ( $max - length( $field ) ) ) . ": %s\n";
132 }
133 0 $template .= "\n";
134 0 my @data = ();
135 0 ▶ while( @data = $self->fetchrow() )
Branch: 1 branch
BranchTrueFalseTotal
if (@data = $self->fetchrow) 0 0 0
136 {
137 0 $fh->printf( $template, @data );
138 }
139 0 $self->finish();
140 0 return( $self );
141 }
142  
143 # Inherited from DB::Object::Statement
144 # sub execute
145  
146 # Inherited from DB::Object::Statement
147 # sub executed
148  
149 # Inherited from DB::Object::Statement
150 # sub fetchall_arrayref($@)
151  
152 # Inherited from DB::Object::Statement
153 # sub fetchcol($;$)
154  
155 # Inherited from DB::Object::Statement
156 # sub fetchhash(@)
157  
158 # Inherited from DB::Object::Statement
159 # sub fetchrow(@)
160  
161 # Inherited from DB::Object::Statement
162 # sub finish
163  
164 sub ignore
165 0 ▶{
Subroutine ignore: not called CC=9 SCAR=45.0
Pod documented
166 0 my $self = shift( @_ );
167 my $query = $self->{query} ||
168 0 ▶ return( $self->error( "No query to set as to be ignored." ) );
Condition0%0/2
$self->{'query'} || (return $self->error('No query to set as to be ignored.'))
l!l
00
MC/DC0%0/1
$self->{'query'} || (return $self->error('No query to set as to be ignored.'))
$self->{'query'}
Truth table0%0/2
A
A= $self->{'query'}
Aresult
11
00
169  
170 0 my $type = uc( ( $query =~ /^[[:blank:]]*(\S+)[[:blank:]]+/ )[ 0 ] );
171 # ALTER for table alteration statements (DB::Object::Tables
172 0 my @allowed = qw( INSERT UPDATE ALTER );
173 0 my $allowed = CORE::join( '|', @allowed );
174 0 ▶ if( !scalar( grep{ /^$type$/i } @allowed ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (scalar grep({/^$type$/i;} @allowed)) 0 0 0
175 {
176 0 return( $self->error( "You may not flag statement of type \U$type\E to be ignored:\n$query" ) );
177 }
178 # Incompatible. Do not bother going further
179 0 ▶ return( $self ) if( $query =~ /^[[:blank:]]*(?:$allowed)[[:blank:]]+(?:DELAYED|LOW_PRIORITY|HIGH_PRIORITY)[[:blank:]]+/i );
Branch: 1 branch
BranchTrueFalseTotal
if $query =~ /^[[:blank:]]*(?:$allowed)[[:blank:]]+(?:DELAYED|LOW_PRIORITY|HIGH_PRIORITY)[[:blank:]]+/i 0 0 0
180 0 ▶ return( $self ) if( $type eq 'ALTER' && $query !~ /^[[:blank:]]*$type[[:blank:]]+TABLE[[:blank:]]+/i );
Branch: 1 branch
BranchTrueFalseTotal
if $type eq "ALTER" and not $query =~ /^[[:blank:]]*${type}[[:blank:]]+TABLE[[:blank:]]+/i 0 0 0
Condition0%0/3
$type eq "ALTER" and not $query =~ /^[[:blank:]]*${type}[[:blank:]]+TABLE[[:blank:]]+/i
!ll&&!rl&&r
000
MC/DC0%0/2
$type eq "ALTER" and not $query =~ /^[[:blank:]]*${type}[[:blank:]]+TABLE[[:blank:]]+/i
$type eq "ALTER" not $query =~ /^[[:blank:]]*${type}[[:blank:]]+TABLE[[:blank:]]+/i
Truth table0%0/3
A and not(B)
A= $type eq "ALTER"B= not $query =~ /^[[:blank:]]*${type}[[:blank:]]+TABLE[[:blank:]]+/i
ABresult
0X0
100
111
181  
182 0 $query =~ s/^([[:blank:]]*)($allowed)([[:blank:]]+)/$1$2 IGNORE /;
183 0 ▶ my $sth = $self->_cache_this( $query ) ||
Condition0%0/2
$self->_cache_this($query) || (return $self->error("Error while preparing new ignored query:\n$query"))
l!l
00
MC/DC0%0/1
$self->_cache_this($query) || (return $self->error("Error while preparing new ignored query:\n$query"))
$self->_cache_this($query)
Truth table0%0/2
A
A= $self->_cache_this($query)
Aresult
11
00
184 return( $self->error( "Error while preparing new ignored query:\n$query" ) );
185 0 ▶ if( !defined( wantarray() ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined wantarray) 0 0 0
186 {
187 0 ▶ $sth->execute() ||
Branch: 1 branch
BranchTrueFalseTotal
$sth->execute or return $self->error("Error while executing new ignored query:\n$query") 0 0 0
188 return( $self->error( "Error while executing new ignored query:\n$query" ) );
189 }
190 0 return( $sth );
191 }
192  
193 # Inherited from DB::Object::Statement
194 # sub join
195  
196 # Inherited from DB::Object::Statement
197 # sub object
198  
199 sub only
200 0 ▶{
Subroutine only: not called CC=1 SCAR=6.9
Pod documented
201 0 return( shift->error( "SELECT | DELETE | UPDATE ONLY is not supported by Mysql." ) );
202 }
203  
204 sub priority
205 0 ▶{
Subroutine priority: not called CC=12 SCAR=50.5
Pod documented
206 0 my $self = shift( @_ );
207 0 my $prio = shift( @_ );
208 0 my $map =
209 {
210 0 => 'LOW_PRIORITY',
211 1 => 'HIGH_PRIORITY',
212 };
213 # Bad argument. Do not bother
214 0 ▶ return( $self ) if( !exists( $map->{ $prio } ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $map->{$prio} 0 0 0
215  
216 my $query = $self->{query} ||
217 0 ▶ return( $self->error( "No query to set priority for was provided." ) );
Condition0%0/2
$self->{'query'} || (return $self->error('No query to set priority for was provided.'))
l!l
00
MC/DC0%0/1
$self->{'query'} || (return $self->error('No query to set priority for was provided.'))
$self->{'query'}
Truth table0%0/2
A
A= $self->{'query'}
Aresult
11
00
218 0 my $type = uc( ( $query =~ /^[[:blank:]]*(\S+)[[:blank:]]+/ )[ 0 ] );
219 0 my @allowed = qw( DELETE INSERT REPLACE SELECT UPDATE );
220 0 my $allowed = CORE::join( '|', @allowed );
221 # Ignore if not allowed
222 0 ▶ if( !scalar( grep{ /^$type$/i } @allowed ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (scalar grep({/^$type$/i;} @allowed)) 0 0 0
223 {
224 0 $self->error( "You may not set priority on statement of type \U$type\E:\n$query" );
225 0 return( $self );
226 }
227 # Incompatible. Do not bother going further
228 0 ▶ return( $self ) if( $query =~ /^\s*(?:$allowed)\s+(?:DELAYED|LOW_PRIORITY|HIGH_PRIORITY)\s+/i );
Branch: 1 branch
BranchTrueFalseTotal
if $query =~ /^\s*(?:$allowed)\s+(?:DELAYED|LOW_PRIORITY|HIGH_PRIORITY)\s+/i 0 0 0
229 # SELECT with something else than HIGH_PRIORITY is incompatible, so do not bother to go further
230 0 ▶ return( $self ) if( $prio != 1 && $type =~ /^(?:SELECT)$/i );
Branch: 1 branch
BranchTrueFalseTotal
if $prio != 1 and $type =~ /^(?:SELECT)$/i 0 0 0
Condition0%0/3
$prio != 1 and $type =~ /^(?:SELECT)$/i
!ll&&!rl&&r
000
MC/DC0%0/2
$prio != 1 and $type =~ /^(?:SELECT)$/i
$prio != 1 $type =~ /^(?:SELECT)$/i
Truth table0%0/3
A and B
A= $prio != 1B= $type =~ /^(?:SELECT)$/i
ABresult
0X0
100
111
231 0 ▶ return( $self ) if( $prio != 0 && $type =~ /^(?:DELETE|INSERT|REPLACE|UPDATE)$/i );
Branch: 1 branch
BranchTrueFalseTotal
if $prio != 0 and $type =~ /^(?:DELETE|INSERT|REPLACE|UPDATE)$/i 0 0 0
Condition0%0/3
$prio != 0 and $type =~ /^(?:DELETE|INSERT|REPLACE|UPDATE)$/i
!ll&&!rl&&r
000
MC/DC0%0/2
$prio != 0 and $type =~ /^(?:DELETE|INSERT|REPLACE|UPDATE)$/i
$prio != 0 $type =~ /^(?:DELETE|INSERT|REPLACE|UPDATE)$/i
Truth table0%0/3
A and B
A= $prio != 0B= $type =~ /^(?:DELETE|INSERT|REPLACE|UPDATE)$/i
ABresult
0X0
100
111
232  
233 0 $query =~ s/^([[:blank:]]*)($allowed)([[:blank:]]+)/$1$2 $map->{ $prio } /i;
234 0 ▶ my $sth = $self->_cache_this( $query ) ||
Condition0%0/2
$self->_cache_this($query) || (return $self->error("Error while preparing new low priority query:\n$query"))
l!l
00
MC/DC0%0/1
$self->_cache_this($query) || (return $self->error("Error while preparing new low priority query:\n$query"))
$self->_cache_this($query)
Truth table0%0/2
A
A= $self->_cache_this($query)
Aresult
11
00
235 return( $self->error( "Error while preparing new low priority query:\n$query" ) );
236 0 ▶ if( !defined( wantarray() ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined wantarray) 0 0 0
237 {
238 0 ▶ $sth->execute() ||
Branch: 1 branch
BranchTrueFalseTotal
$sth->execute or return $self->error("Error while executing new low priority query:\n$query") 0 0 0
239 return( $self->error( "Error while executing new low priority query:\n$query" ) );
240 }
241 0 return( $sth );
242 }
243  
244 # rollback is called using the dbh handler and is located in DB::Object::Postgres
245  
246 # Inherited from DB::Object::Statement
247 # sub rows(@)
248  
249 # Inherited from DB::Object::Statement
250 # sub undo
251  
252 sub wait
253 0 ▶{
Subroutine wait: not called CC=7 SCAR=40.3
Pod documented
254 0 my $self = shift( @_ );
255 my $query = $self->{query} ||
256 0 ▶ return( $self->error( "No query to set as to be delayed." ) );
Condition0%0/2
$self->{'query'} || (return $self->error('No query to set as to be delayed.'))
l!l
00
MC/DC0%0/1
$self->{'query'} || (return $self->error('No query to set as to be delayed.'))
$self->{'query'}
Truth table0%0/2
A
A= $self->{'query'}
Aresult
11
00
257 0 my $type = ( $query =~ /^[[:blank:]]*(\S+)[[:blank:]]+/ )[ 0 ];
258 0 my @allowed = qw( INSERT REPLACE );
259 0 my $allowed = CORE::join( '|', @allowed );
260 # Ignore if not allowed
261 0 ▶ if( !scalar( grep{ /^$type$/i } @allowed ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (scalar grep({/^$type$/i;} @allowed)) 0 0 0
262 {
263 0 $self->error( "You may not use wait (delayed query) on statement of type \U$type\E:\n$query" );
264 0 return( $self );
265 }
266 # Incompatible. Do not bother going further
267 0 ▶ return( $self ) if( $query =~ /^[[:blank:]]*(?:$allowed)[[:blank:]]+(?:DELAYED|LOW_PRIORITY|HIGH_PRIORITY)[[:blank:]]+/i );
Branch: 1 branch
BranchTrueFalseTotal
if $query =~ /^[[:blank:]]*(?:$allowed)[[:blank:]]+(?:DELAYED|LOW_PRIORITY|HIGH_PRIORITY)[[:blank:]]+/i 0 0 0
268 0 $query =~ s/^([[:blank:]]*)($allowed)([[:blank:]]+)/$1$2 DELAYED /i;
269 0 ▶ my $sth = $self->_cache_this( $query ) ||
Condition0%0/2
$self->_cache_this($query) || (return $self->error("Error while preparing new delayed query:\n$query"))
l!l
00
MC/DC0%0/1
$self->_cache_this($query) || (return $self->error("Error while preparing new delayed query:\n$query"))
$self->_cache_this($query)
Truth table0%0/2
A
A= $self->_cache_this($query)
Aresult
11
00
270 return( $self->error( "Error while preparing new delayed query:\n$query" ) );
271 0 ▶ if( !defined( wantarray() ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined wantarray) 0 0 0
272 {
273 0 ▶ $sth->execute() ||
Branch: 1 branch
BranchTrueFalseTotal
$sth->execute or return $self->error("Error while executing new delayed query:\n$query") 0 0 0
274 return( $self->error( "Error while executing new delayed query:\n$query" ) );
275 }
276 0 return( $sth );
277 }
278  
279 DESTROY
280 0 ▶{
Subroutine DESTROY: not called CC=1 SCAR=0.0
281 # Do nothing but existing so it is handled by this package
282 # print( STDERR "DESTROY'ing statement $self ($self->{ 'query' })\n" );
283 };
284  
285 1 1;
286 # NOTE: POD
287 __END__
« lib/DB/Object/Query/Clause.pm ↑ Summary blib/lib/DB/Object/Mysql/Query.pm »