Bug #52860 ambiguous wording "affected rows" in c/J docs
Submitted: 15 Apr 2010 14:54 Modified: 14 May 2010 13:58
Reporter: Axel Schwenke Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Documentation Severity:S4 (Feature request)
Version:n/a OS:Any
Assigned to: Tony Bedford CPU Architecture:Any

[15 Apr 2010 14:54] Axel Schwenke
Description:
http://dev.mysql.com/doc/refman/5.1/en/connector-j-usagenotes-basic.html

reads: "To update data in the database, use the executeUpdate(String SQL) method. This method returns the number of rows affected by the update statement."

The wording "affected rows" is ambiguous. In the MySQL context "affected rows" means "modified rows" and is clearly distinguished from "matched rows". The JDBC method however returns the number of matched rows.

This is a slight inconsistency with the behavior of UPDATE statements:

"UPDATE returns the number of rows that were actually changed. The mysql_info() C API function returns the number of rows that were matched and updated and the number of warnings that occurred during the UPDATE." (from http://dev.mysql.com/doc/refman/5.1/en/update.html)

How to repeat:
n/a

Suggested fix:
rewrite the second cited sentence like so: "This method returns the number of rows matched by the update statement, not the number of rows that was actually modified."

I did not check the whole manual. There might be more places where clarification is needed.
[16 Apr 2010 5:48] Tonci Grgin
Thanks Axel.

Tony, please do check if and how it's affected by connection string options too.
[14 May 2010 10:42] Tony Bedford
Have changed the docs as suggested. Did not see anything affected in the connection string options table. Still need to trawl through the rest of the manual before closing.
[14 May 2010 13:58] Tony Bedford
Rest of manual looks OK.