[svn:dbd-oracle] r14695 - dbd-oracle/branches/exe_array

[email protected] Wed, 9 Feb 2011 08:41:53 -0800 (PST)
Newsgroups perl.dbd.oracle.changes
Message-ID <[email protected]>
Author: byterock
Date: Wed Feb  9 08:41:52 2011
New Revision: 14695

Modified:
   dbd-oracle/branches/exe_array/Oracle.pm

Log:
one more little fix

Modified: dbd-oracle/branches/exe_array/Oracle.pm
==============================================================================
--- dbd-oracle/branches/exe_array/Oracle.pm	(original)
+++ dbd-oracle/branches/exe_array/Oracle.pm	Wed Feb  9 08:41:52 2011
@@ -1021,20 +1021,23 @@
            @$tuple_status = ();
            $tuple_batch_status = [ ];
        }
-       
+      use Data::Dumper;
+       my $finished;
        while (1) {
            my @tuple_batch;
            for (my $i = 0; $i < $batch_size; $i++) {
-                push @tuple_batch, [ @{$fetch_tuple_sub->() || last} ];
+               $finished = $fetch_tuple_sub->();
+               push @tuple_batch, [@{$finished || last}];
+
            }
            last unless @tuple_batch;
+           
            my $res = ora_execute_array($sth,
                                            \@tuple_batch,
                                            scalar(@tuple_batch),
                                            $tuple_batch_status,
                                            $err_count );
                                            
-           
            if(defined($res)) { #no error
                 $row_count += $res;
            } else {
@@ -1043,8 +1046,9 @@
            
            $tuple_count+=@$tuple_batch_status;
            push @$tuple_status, @$tuple_batch_status
-           	if defined($tuple_status);
-           	
+                if defined($tuple_status);
+           
+           last if !$finished;	
            
        }
        #error check here