Re: more on execute_array not complying with the specification

Tim Bunce <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase.devel
Message-ID <[email protected]>
On Mon, Jan 31, 2011 at 08:39:40PM +0000, Martin J. Evans wrote:
> I imagine most DBDs [if not all] that implement execute_array

[Just a reminder that drivers can opt to implement just
execute_for_fetch() and use the DBI's default execute_array() method,
which then calls execute_for_fetch().]

> themselves) the rows affected will be -1 per execute (as the driver
> does not know affected rows) and so I'd expect $rows to be -1 and
> not 18. DBI gets away with this as it does an execute for each row
> and hence knows the rows affected as the return from each execute.
> The statement saying sum of affected rows should not sum a load of
> -1s affected to be -N.

Yes. The spec ought to say that if any tuple gets a -1 then -1 gets
returned as the 'sum', even if other tuples return other values.

Tim.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.