You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Save affected_rows on the wrapper when reading results (#1383)
Between fetching the result and accessing the affected_rows property, GC
might have been triggered and might have freed some Mysql2::Statement
objects. This calls mysql_stmt_close which resets the connection
affected_rows to -1, which in turn is treated as an error when calling
mysql_affected_rows.
```
client.query("SELECT 1")
client.affected_rows # raises Mysql2::Error
```
Note that the data type of mysql_affected_rows changed from my_ulonglong
to uint64_t starting with MySQL 8.0. Older versions should still work, though.
0 commit comments