DBD 2.9002 and documentation

DBD 2.9002 and documentation

am 14.09.2005 09:57:01 von Nitzan Shaked

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 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.

Thanks,
Nitzan



--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: DBD 2.9002 and documentation

am 14.09.2005 15:55:55 von Rudy Lippan

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/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

Re: DBD 2.9002 and documentation

am 14.09.2005 18:31:00 von Paul DuBois

At 9:55 -0400 9/14/05, Rudy Lippan wrote:
>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.

Also, with regard to the "(and other)", there are other APIs that
have a different default than the C API -- MySQL Connector/J (JDBC)
also defaults to rows-matched, because that it required by the JDBC
spec.
--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=gcdmp-msql-mysql-modules@m .gmane.org

úùåáä: Re: DBD 2.9002 and documentation

am 15.09.2005 01:08:24 von Nitzan Shaked

Rudy=2C Paul

Thanks for your answers At least now I know this is the intended beha=
vior and I feel better in relying on this

Best regards=2C
Nitzan

----- äåãòä î÷åøéú -----
îàú: Rudy Lippan =3Crlippan=40remotelinuxcom=3E
úàøéê: éå=ED ã'=2C ñôèîáø 14=2C 2005 16=3A=
55
ðåùà=3A Re=3A DBD 29002 and documentation

=3E =

=3E =

=3E On Wed=2C 14 Sep 2005=2C nitzan shaked wrote=3A
=3E =

=3E =3E DBD 29002 changed the behavior of returned value from do()=3A=
it =

=3E now returns the number of *matched*
=3E =3E rows by default=2C and not the number of actually-changed rows=
=

=3E This is documented in the changelog
=3E =3E
=3E =3E However=2C the DBI documentation states the value returned is th=
e =

=3E number of affected rows (not
=3E =3E matched rows)=2C and even still claims (under the =22MySQL =

=3E features=22) that you can =22change this using
=3E =3E a connection-string parameter".
=3E =3E
=3E =3E This suggests to me that the documentation is wrong=3A it =

=3E acknowledges that both options exist=2C and
=3E =3E that claims the default is something which it=27s not
=3E =3E
=3E =

=3E The docs are wrong I probably forgot to update them when I made =

=3E the change
=3E Mea culpa=2C mea culpa....
=3E =

=3E =3E The question is also what happens in the C (and other) API=3A is=
=

=3E this the default or not=3F Is the default
=3E =3E *different* between APIs=3F
=3E =3E
=3E =3E In short=2C is this=3A
=3E =3E 1) A documentation error=2C and all API=27s are aligned=2C or=3A=

=3E =3E 2) A DBD-specific error=2C which should conform to some default =

=3E but doesn=27t
=3E =3E
=3E =

=3E Neither =3A) It is a documentation error=2C and the documentatio=
n =

=3E should =

=3E read that rows() (and do()) returns the number of matched rows by =

=3E default The
=3E C API defaults to the number of changed rows=2C so if you want the C=
=

=3E API =

=3E behaviour=2C you have to pass =22mysql=5Ffound=5Frows=3D0=22 to con=
nect
=3E =

=3E -r
=3E


--
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe: http://lists.mysql.com/perl?unsub=3Dgcdmp-msql-mysql-modules @m.gmane.org