Re: DBD 2.9002 and documentation

Rudy Lippan <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>

On Wed, 14 Sep 2005, nitzan shaked wrote:

> DBD 2.9002 changed the behavior of returned value from do(): it now returns the number of *matched*
> rows by default, and not the number of actually-changed rows. This is documented in the changelog.
>
> However, the DBI documentation states the value returned is the number of affected rows (not
> matched rows), and even still claims (under the "MySQL features") that you can "change this using
> a connection-string parameter".
>
> This suggests to me that the documentation is wrong: it acknowledges that both options exist, and
> that claims the default is something which it's not.
>

The docs are wrong. I probably forgot to update them when I made the change.
Mea culpa, mea culpa....

> The question is also what happens in the C (and other) API: is this the default or not? Is the default
> *different* between APIs?
>
> In short, is this:
> 1) A documentation error, and all API's are aligned, or:
> 2) A DBD-specific error, which should conform to some default but doesn't.
>

Neither :).  It is a documentation error, and the documentation should 
read that rows() (and do()) returns the number of matched rows by default. The
C API defaults to the number of changed rows, so if you want the C API 
behaviour, you have to pass  "mysql_found_rows=0" to connect.

-r

-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
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.