<div dir="ltr">Hi,<div><br></div><div>I have noticed that in some instances if you update a row in mysql via the mysql_db module and the actual row data does not change - affected_rows will return 0. This is the default behaviour for the mysql API as per - <a href="http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html">http://dev.mysql.com/doc/refman/5.0/en/mysql-real-connect.html</a></div>
<div><br></div><div>There is a flag (CLIENT_FOUND_ROWS) that can be used in the mysql_real_connect function that will cause affected_rows to return the number of rows that were "matched" - ie in the WHERE clause, as opposed to whether or not any data was changed.</div>
<div><br></div><div>If we don't it could be a problem for modules like usrloc where an update is done and if no row are "affected" and new row is added which would cause a duplicate.</div><div><br></div><div>
I understand that updating a row with zero changes is not ideal and prob. not a typical use case but this IMO is irrelevant. I understand affected rows to mean the number of rows that were matched and not the number of rows that had data changed... - seems like a case of MySQL being too clever here ;)</div>
<div><br></div><div>Thoughts? <br></div><div><br></div><div>Cheers</div><div>Jason</div><div><br></div><div><br></div></div>