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: 80375
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: no exception w/o ArrayTupleStatus
use DBI(); my $dbh = DBI->connect or die $DBI::errstr; $dbh->{RaiseError} = 1; $dbh->{PrintError} = 0; $dbh->{AutoCommit} = 0; # $dbh->do('create table mytest( a int )'); $dbh->prepare('insert into mytest values (?)')->execute_array( {}, ['_1'] ); If ArrayTupleStatus is omitted, err_count is not set and thence no exception is raised. Patch attached.
Subject: dbdimp.c.diff
--- dbdimp.152 Fri Oct 19 16:41:17 2012 +++ dbdimp.c Wed Oct 24 10:57:12 2012 @@ -3883,13 +3883,15 @@ " ora_st_execute_array %d errors in batch.\n", num_errs); + if(num_errs) { + sv_setiv(err_count,num_errs); + } if(num_errs && tuples_status_av) { OCIError *row_errhp, *tmp_errhp; ub4 row_off; SV *err_svs[3]; /*AV *err_av;*/ sb4 err_code; - sv_setiv(err_count,num_errs); err_svs[0] = newSViv((IV)0); err_svs[1] = newSVpvn("", 0); err_svs[2] = newSVpvn("S1000",5);
On Wed Oct 24 06:17:21 2012, SGOELDNER wrote: Show quoted text
> use DBI(); > > my $dbh = DBI->connect or die $DBI::errstr; > $dbh->{RaiseError} = 1; > $dbh->{PrintError} = 0; > $dbh->{AutoCommit} = 0; > > # $dbh->do('create table mytest( a int )'); > $dbh->prepare('insert into mytest values (?)')->execute_array( {}, > ['_1'] ); > > If ArrayTupleStatus is omitted, err_count is not set and thence > no exception is raised. > > Patch attached.
and I thought the tests for execute_for_fetch were pretty comprehensive - it is certainly the biggest test in DBD::Oracle. Thanks again Steffen. I think I'd like to write a test for that first before committing that patch so it might take a little longer. I presume you are ok with that as you've already patched it. Martin -- Martin J. Evans Wetherby, UK
Show quoted text
> Thanks again Steffen. I think I'd like to write a test for that first > before committing that patch so it might take a little longer. I presume > you are ok with that as you've already patched it.
Yes, ok! Tests are good! I just found that $tuple_count+=@$tuple_batch_status; is also wrong in this case (and prints an undefined warning). I'd suggest $tuple_count += @tuple_batch; instead.
On Wed Oct 24 07:05:15 2012, SGOELDNER wrote: Show quoted text
> > Thanks again Steffen. I think I'd like to write a test for that first > > before committing that patch so it might take a little longer. I presume > > you are ok with that as you've already patched it.
> > Yes, ok! Tests are good! I just found that > > $tuple_count+=@$tuple_batch_status; > > is also wrong in this case (and prints an undefined warning). > I'd suggest > > $tuple_count += @tuple_batch; > > instead.
I guess no one tested without tuple_status. I will fix this too. Martin -- Martin J. Evans Wetherby, UK
On Wed Oct 24 08:14:17 2012, MJEVANS wrote: Show quoted text
> On Wed Oct 24 07:05:15 2012, SGOELDNER wrote:
> > > Thanks again Steffen. I think I'd like to write a test for that first > > > before committing that patch so it might take a little longer. I
presume Show quoted text
> > > you are ok with that as you've already patched it.
> > > > Yes, ok! Tests are good! I just found that > > > > $tuple_count+=@$tuple_batch_status; > > > > is also wrong in this case (and prints an undefined warning). > > I'd suggest > > > > $tuple_count += @tuple_batch; > > > > instead.
> > I guess no one tested without tuple_status. I will fix this too. > > Martin
Should be fixed in subversion trunk and tests added. Thanks again Stefen. Martin -- Martin J. Evans Wetherby, UK
Show quoted text
> Should be fixed in subversion trunk and tests added.
Fine. One small issue: make test doesn't find ExecuteArray.pm. IMHO we need on of #!perl -I./t or use lib './t'; or unshift @INC ,'t'; require 'nchar_test_lib.pl'; require ExecuteArray;
On Tue Oct 30 06:50:55 2012, SGOELDNER wrote: Show quoted text
> > Should be fixed in subversion trunk and tests added.
> > Fine. One small issue: make test doesn't find ExecuteArray.pm. > IMHO we need on of > > #!perl -I./t > > or > > use lib './t'; > > or > > unshift @INC ,'t'; > require 'nchar_test_lib.pl'; > require ExecuteArray;
Done. Think I must have removed the #!perl -I./t before I checked in. Martin -- Martin J. Evans Wetherby, UK