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;

Reply via email to