Author: timbo
Date: Sat Jul 19 23:43:16 2008
New Revision: 11544
Modified:
dbi/trunk/Changes
dbi/trunk/DBI.pm
dbi/trunk/DBI.xs
dbi/trunk/lib/DBI/Gofer/Execute.pm
dbi/trunk/t/40profile.t
Log:
Fix missing 'use' in DBI/Gofer/Execute.pm
Allow profile count to be NV, but preserve IV if possible.
Make t/40profile.t less time sensitive (for slow systems).
Clarify docs for quote()
Add note to execute() docs about execute(@emptyarray);
Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes (original)
+++ dbi/trunk/Changes Sat Jul 19 23:43:16 2008
@@ -54,6 +54,16 @@
Add high-res time for windows - via Time::HiRes glob replace dbi_time().
+=head2 Changes in DBI 1.606
+
+Fix PERL_UNUSED_VAR for 5.6.2 - update ppport.h?
+No longer support 5.6? In future.
+(Access to recent errors in gofer http transport)
+
+ Fixed missing import of carp in DBI::Gofer::Execute.
+
+ Added note to docs about effect of execute(@empty_array).
+
=head2 Changes in DBI 1.605 (svn r11434) 16th June 2008
Fixed broken DBIS macro with threads on big-endian machines
Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm (original)
+++ dbi/trunk/DBI.pm Sat Jul 19 23:43:16 2008
@@ -5191,8 +5191,9 @@
$sql = sprintf "SELECT foo FROM bar WHERE baz = %s",
$dbh->quote("Don't");
-For most database types, quote would return C<'Don''t'> (including the
-outer quotation marks).
+For most database types, at least those that conform to SQL standards, quote
+would return C<'Don''t'> (including the outer quotation marks). For others it
+may return something like C<'Don\'t'>
An undefined C<$value> value will be returned as the string C<NULL> (without
single quotation marks) to match how NULLs are represented in SQL.
@@ -5605,6 +5606,10 @@
C<bind_param> (or C<bind_param_inout>) has already been used to
specify the type.
+Note that passing C<execute> an empty array is the same as passing no arguments
+at all, which will execute the statement with previously bound values.
+That's probably not what you want.
+
If execute() is called on a statement handle that's still active
($sth->{Active} is true) then it should effectively call finish()
to tidy up the previous execution results before starting this new
Modified: dbi/trunk/DBI.xs
==============================================================================
--- dbi/trunk/DBI.xs (original)
+++ dbi/trunk/DBI.xs Sat Jul 19 23:43:16 2008
@@ -2712,6 +2712,7 @@
dTHX;
AV *d_av, *i_av;
SV *tmp;
+ SV *tmp2;
NV i_nv;
int i_is_earlier;
@@ -2747,8 +2748,12 @@
croak("dbi_profile_merge_nodes: increment %s not an array or hash ref",
neatsvpv(increment,0));
i_av = (AV*)SvRV(increment);
- tmp = *av_fetch(d_av, DBIprof_COUNT, 1);
- sv_setiv( tmp, SvIV(tmp) + SvIV( *av_fetch(i_av, DBIprof_COUNT, 1)) );
+ tmp = *av_fetch(d_av, DBIprof_COUNT, 1);
+ tmp2 = *av_fetch(i_av, DBIprof_COUNT, 1);
+ if (SvIOK(tmp) && SvIOK(tmp2))
+ sv_setiv( tmp, SvIV(tmp) + SvIV(tmp2) );
+ else
+ sv_setnv( tmp, SvNV(tmp) + SvNV(tmp2) );
tmp = *av_fetch(d_av, DBIprof_TOTAL_TIME, 1);
sv_setnv( tmp, SvNV(tmp) + SvNV( *av_fetch(i_av, DBIprof_TOTAL_TIME, 1)) );
Modified: dbi/trunk/lib/DBI/Gofer/Execute.pm
==============================================================================
--- dbi/trunk/lib/DBI/Gofer/Execute.pm (original)
+++ dbi/trunk/lib/DBI/Gofer/Execute.pm Sat Jul 19 23:43:16 2008
@@ -10,6 +10,8 @@
use strict;
use warnings;
+use Carp;
+
use DBI qw(dbi_time);
use DBI::Gofer::Request;
use DBI::Gofer::Response;
Modified: dbi/trunk/t/40profile.t
==============================================================================
--- dbi/trunk/t/40profile.t (original)
+++ dbi/trunk/t/40profile.t Sat Jul 19 23:43:16 2008
@@ -296,7 +296,7 @@
# if actual "!Time" recorded is 'close enough' then we'll pass
# the test - it's not worth failing just because a system is slow
-$t1 = (keys %$tmp)[0] if (abs($t1 - (keys %$tmp)[0]) <= 2);
+$t1 = (keys %$tmp)[0] if (abs($t1 - (keys %$tmp)[0]) <= 5);
is_deeply $tmp, {
$t1 => { $t2 => { prepare => [ 1, 0, 0, 0, 0, 0, 0 ] }}