Crosspost from the Zeos forums. Link and better text will be provided later, since the forums are offline currently.
The bottom line is: If one uses a TZUpdateSQL component, edits a line in a dataset but doesn't change values - or changes them back to their original values before it is posted - ant then posts the modified record, an exception with the message "0 record(s) updated. Only one record should have been updated.".
IMHO, the behavior is expected.
Turn off the check: "ValidateUpdateCount=false", see DSProps_ValidateUpdateCount (ZDbcProperties)
Or use the Zeos.inc define WITH_VALIDATE_UPDATE_COUNT.
What exactly is the bug? Nothing changes -> no update or what?
Added two test cases to ZTestCompCoreBugReport: TestSF270_1 and TestSF270_2: TestSF270_1 tests this without a TZUpdateSQL component assigned. TestSF270_2 tests this with a TZUpdateSQL component assigned. I chose ZTestCompCoreBugReport so we can see wether this happens on other databases too.
Sooo - we found the reason for this behaviour: MySQL returns the number of changed rows by default. If the data of a row doesn't change, 0 is returned. See https://dev.mysql.com/doc/refman/8.0/en/mysql-affected-rows.html .
This behaviour can be changed by adding "CLIENT_FOUND_ROWS=1" to the TZConnection.Properties property.
I suggest to enable this option for Zeos 7.3 by default, so the TZUpdateSQL component works correctly by default. This change in behaviour would need to be documented accordingly then.
Last edit: marsupilami79 2018-07-20
Added New/Old-Row comparsion as made in the genericresolver in R5417.
Tests do not show any side effects. If nothing is todo, nothing is send to the server, which is nice for all providers...
Closed, reopen if not OK.