[svn:dbi] r15426 - dbi/branches/sqlengine/lib/DBI/DBD

[email protected] Fri, 5 Oct 2012 06:11:42 -0700 (PDT)
Newsgroups perl.dbi.changes
Message-ID <[email protected]>
Author: REHSACK
Date: Fri Oct  5 06:11:42 2012
New Revision: 15426

Modified:
   dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm

Log:
re-introduce ->{sql_params_checked} to handle SQL::Statement limitations

Modified: dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm
==============================================================================
--- dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm	(original)
+++ dbi/branches/sqlengine/lib/DBI/DBD/SqlEngine.pm	Fri Oct  5 06:11:42 2012
@@ -1170,14 +1170,18 @@
     $sth->finish;
     my $stmt = $sth->{sql_stmt};
 
-    # SQL::Statement and DBI::SQL::Nano will return the list of required params
-    # when called in list context. Do not look into the several items, they're
-    # implementation specific and may change without warning
-    unless ( ( my $req_prm = $stmt->params() ) == ( my $nparm = @$params ) )
-    {
-        my $msg = "You passed $nparm parameters where $req_prm required";
-        $sth->set_err( $DBI::stderr, $msg );
-        return;
+    # must not proved when already executed - SQL::Statement modifies
+    # received params
+    unless ( $sth->{sql_params_checked}++ )
+    {
+	# SQL::Statement and DBI::SQL::Nano will return the list of required params
+	# when called in list context. Do not look into the several items, they're
+	# implementation specific and may change without warning
+	unless ( ( my $req_prm = $stmt->params() ) == ( my $nparm = @$params ) )
+	{
+	    my $msg = "You passed $nparm parameters where $req_prm required";
+	    return $sth->set_err( $DBI::stderr, $msg );
+	}
     }
 
     my @err;