Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the DBD-Oracle CPAN distribution.

Report information
The Basics
Id: 80349
Status: resolved
Priority: 0/
Queue: DBD-Oracle

People
Owner: Nobody in particular
Requestors: sgoeldner [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.56



Subject: execute_array: wrong $err_count
Download (untitled) / with headers
text/plain 504b
my $dbh = DBI->connect or die $DBI::errstr; $dbh->{RaiseError} = 1; $dbh->{PrintError} = 0; $dbh->{AutoCommit} = 0; $dbh->{ora_array_chunk_size} = 3; $dbh->prepare('insert into mytest values (?)') ->execute_array( { ArrayTupleStatus => [] }, [ '_1', '_2', 3 , 11 ,'_22', 33 , 111 , 222 ,333 ] ); shows DBD::Oracle::st execute_array failed: ORA-24381 ... executing 9 generated 1 errors ... i.e. the errors of the last failed batch, instead of 3 total errors. Patch attached.
Subject: Oracle.pm.diff
Download Oracle.pm.diff
text/x-diff 1.3k
--- Oracle.152 Fri Oct 19 16:41:17 2012 +++ Oracle.pm Tue Oct 23 10:44:36 2012 @@ -1076,7 +1076,7 @@ sub execute_for_fetch { my ($sth, $fetch_tuple_sub, $tuple_status) = @_; my $row_count = 0; - my $err_count = 0; + my $err_total = 0; my $tuple_count="0E0"; my $tuple_batch_status; my $dbh = $sth->{Database}; @@ -1096,6 +1096,7 @@ } last unless @tuple_batch; + my $err_count = 0; my $res = ora_execute_array($sth, \@tuple_batch, scalar(@tuple_batch), @@ -1107,7 +1108,7 @@ } else { $row_count = undef; } - + $err_total += $err_count; $tuple_count+=@$tuple_batch_status; push @$tuple_status, @$tuple_batch_status if defined($tuple_status); @@ -1116,8 +1117,8 @@ } #error check here - return $sth->set_err($DBI::stderr, "executing $tuple_count generated $err_count errors") - if $err_count; + return $sth->set_err($DBI::stderr, "executing $tuple_count generated $err_total errors") + if $err_total; return wantarray ? ($tuple_count, defined $row_count ? $row_count : undef)
Download (untitled) / with headers
text/plain 686b
On Tue Oct 23 06:05:16 2012, SGOELDNER wrote: Show quoted text
> my $dbh = DBI->connect or die $DBI::errstr; > $dbh->{RaiseError} = 1; > $dbh->{PrintError} = 0; > $dbh->{AutoCommit} = 0; > $dbh->{ora_array_chunk_size} = 3; > > $dbh->prepare('insert into mytest values (?)') > ->execute_array( { ArrayTupleStatus => [] }, [ > '_1', '_2', 3 > , 11 ,'_22', 33 > , 111 , 222 ,333 > ] ); > > shows > > DBD::Oracle::st execute_array failed: ORA-24381 ... > executing 9 generated 1 errors ... > > i.e. the errors of the last failed batch, instead of > 3 total errors. > > Patch attached.
Thanks Steffen. Applied patch to subversion trunk. Martin -- Martin J. Evans Wetherby, UK


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.