Skip to content

Commit

Permalink
fix: pass CLIENT_FOUND_ROWS (#1)
Browse files Browse the repository at this point in the history
This changes the behavior of the affected count returned for mutations (UPDATE/INSERT etc). It makes MySQL return the FOUND rows instead of the AFFECTED rows. Without this, MySQL returns 0 affected row when performing a noop update. This breaks the QueryEngine when performing nested connects which expect the update to have happened.

You can read more about it here https://dev.mysql.com/doc/refman/8.0/en/information-functions.html.
  • Loading branch information
Weakky authored Feb 7, 2023
1 parent e3f8bdb commit b5d16fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,8 @@ impl Opts {
| CapabilityFlags::CLIENT_MULTI_RESULTS
| CapabilityFlags::CLIENT_PS_MULTI_RESULTS
| CapabilityFlags::CLIENT_DEPRECATE_EOF
| CapabilityFlags::CLIENT_PLUGIN_AUTH;
| CapabilityFlags::CLIENT_PLUGIN_AUTH
| CapabilityFlags::CLIENT_FOUND_ROWS;

if self.inner.mysql_opts.db_name.is_some() {
out |= CapabilityFlags::CLIENT_CONNECT_WITH_DB;
Expand Down

0 comments on commit b5d16fb

Please sign in to comment.