Author: timbo
Date: Thu Sep 30 09:19:25 2004
New Revision: 473

Modified:
   dbi/trunk/Changes
   dbi/trunk/DBI.pm
Log:
Changed bind_param_array() to error if placeholder number <= 0.
Added default DESTROY method (to avoid initial AUTOLOAD).


Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Thu Sep 30 09:19:25 2004
@@ -14,6 +14,7 @@
 
   Changed bind_param_array() so it doesn't require all bind arrays
     to have the same number of elements.
+  Changed bind_param_array() to error if placeholder number <= 0.
   Changed execute_array() definition, and default implementation,
     to effectively NULL-pad shorter bind arrays.
   Changed execute_array() to return "0E0" for 0 as per the docs.

Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm    (original)
+++ dbi/trunk/DBI.pm    Thu Sep 30 09:19:25 2004
@@ -1278,6 +1278,8 @@
        return 0x00000100 if $name eq 'SQL';
        return;
     }
+
+    sub DESTROY { return }     # avoid AUTOLOAD
 }
 
 
@@ -1649,9 +1651,12 @@
        return $sth->set_err(1, "Value for parameter $p_id must be a scalar or an 
arrayref, not a ".ref($value_array))
            if defined $value_array and ref $value_array and ref $value_array ne 
'ARRAY';
 
-       return $sth->set_err(1, "Can't use named placeholders for non-driver supported 
bind_param_array")
+       return $sth->set_err(1, "Can't use named placeholder '$p_id' for non-driver 
supported bind_param_array")
            unless DBI::looks_like_number($p_id); # because we rely on execute(@ary) 
here
 
+       return $sth->set_err(1, "Placeholder '$p_id' is out of range")
+           if $p_id <= 0; # can't easily/reliably test for too big
+
        # get/create arrayref to hold params
        my $hash_of_arrays = $sth->{ParamArrays} ||= { };
 
@@ -5328,7 +5333,7 @@
 internal "housekeeping" method that is rarely needed.
 See also L</disconnect> and the L</Active> attribute.
 
-The C<finish> method should have been called C<cancel_select>.
+The C<finish> method should have been called C<discard_pending_rows>.
 
 
 =item C<rows>

Reply via email to