Bug #96572 | MySqlCommand.ExecuteNonQuery returns 1 for updates when it affected 0 rows. | ||
---|---|---|---|
Submitted: | 16 Aug 2019 15:34 | Modified: | 20 Aug 2019 5:18 |
Reporter: | Perry Way | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / NET | Severity: | S3 (Non-critical) |
Version: | 8.0 | OS: | Windows |
Assigned to: | CPU Architecture: | Any | |
Tags: | wrong return value |
[16 Aug 2019 15:34]
Perry Way
[16 Aug 2019 20:01]
Bradley Grainger
Make sure you have "UseAffectedRows=true" in your connection string. From https://dev.mysql.com/doc/connector-net/en/connector-net-8-0-connection-options.html > UseAffectedRows , Use Affected Rows > Default: false > > When true, the connection reports changed rows instead of found rows.
[16 Aug 2019 20:20]
Perry Way
Thanks a lot! Was not aware of that setting. Tested it, and it works.
[20 Aug 2019 5:18]
MySQL Verification Team
Thank you, Bradley Grainger. Closing the issue as per last note from Perry. regards, Umesh