On Wed, Feb 08, 2006 at 11:18:24AM -0600, Ben Thul wrote:
> To whom it may concern,
> 
> While doing some development recently, I got an error saying
> "bind_columns called with 3 refs when 2 needed. at
> C:/Perl/site/lib/DBI.pm line 1705.".  I knew what the problem was, but
> not where in my code it was.  The patch that I'm submitting changes
> the "die" on that line to a "Carp::croak", as it's truly a user error
> when that happens.

Thanks Ben. I've taken a slightly different tack but with the same
effect (if RaiseError is set). See attached.

Tim.


Index: Changes
===================================================================
--- Changes     (revision 2485)
+++ Changes     (working copy)
@@ -11,6 +11,8 @@
   Fixed t/40profile.t to be insensitive to long double precision.
   Fixed for perl 5.8.0's more limited weaken() function.
   Fixed DBD::Proxy to not alter $@ in disconnect or AUTOLOADd methods.
+  Fixed bind_columns() to use return set_err(...) instead of die()
+    to report incorrect number of parameters Ben Thul.
 
   Improved performance for thread-enabled perls thanks to Gisle Aas.
   Drivers can now use PERL_NO_GET_CONTEXT thanks to Gisle Aas.
Index: DBI.pm
===================================================================
--- DBI.pm      (revision 2488)
+++ DBI.pm      (working copy)
@@ -1819,8 +1819,9 @@
        my $attr;
        $attr = shift if !defined $_[0] or ref($_[0]) eq 'HASH';
 
-       die "bind_columns called with "[EMAIL PROTECTED]" refs when $fields 
needed."
+       return $sth->set_err(1, "bind_columns called with "[EMAIL PROTECTED]" 
refs when $fields needed")
            if @_ != $fields;
+
        my $idx = 0;
        $sth->bind_col(++$idx, shift, $attr) or return
            while (@_);

Reply via email to