Skip to content

Commit e6312de

Browse files
wolfsagedveeden
authored andcommitted
Mention default and reword mysql_client_found_rows POD for clarity
1 parent 2da4ca7 commit e6312de

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

lib/DBD/mysql.pm

+5-9
Original file line numberDiff line numberDiff line change
@@ -1062,16 +1062,12 @@ Example DSN:
10621062
10631063
=item mysql_client_found_rows
10641064
1065-
Enables (TRUE value) or disables (FALSE value) the flag CLIENT_FOUND_ROWS
1066-
while connecting to the MySQL server. This has a somewhat funny effect:
1067-
Without mysql_client_found_rows, if you perform a query like
1065+
If TRUE (Default), sets the CLIENT_FOUND_ROWS flag when connecting to MySQL.
1066+
This causes UPDATE statements to return the number of rows *matched*, not
1067+
the number of rows actually changed.
10681068
1069-
UPDATE $table SET id = 1 WHERE id = 1;
1070-
1071-
then the MySQL engine will always return 0, because no rows have changed.
1072-
With mysql_client_found_rows however, it will return the number of rows
1073-
that have an id 1, as some people are expecting. (At least for compatibility
1074-
to other engines.)
1069+
If you want the number of rows changed in response to an UPDATE statement,
1070+
specify "mysql_client_found_rows=0" in the DSN.
10751071
10761072
=item mysql_compression
10771073

0 commit comments

Comments
 (0)