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
Since there can only be one active MySqlDataReader per MySqlConnection, we could create just one instance and recycle it when it's disposed.
This could allow a user to start using a disposed reader without failure (once it's been handed out to a different caller). That currently fails with an ObjectDisposedException, so no existing code would be broken, but people could start writing new, broken code.
It also seems to break Dapper's QueryAsync<>, which isn't using that exact pattern (AFAICT) but may trigger some code path that exposes a race condition in MySqlConnector.
The solution may be to make MySqlDataReader as slim as possible (maybe just referencing a ResultSet and MySqlCommand?), and pool and recycle the more heavy-weight ResultSet object.
Since there can only be one active
MySqlDataReader
perMySqlConnection
, we could create just one instance and recycle it when it's disposed.This could allow a user to start using a disposed reader without failure (once it's been handed out to a different caller). That currently fails with an
ObjectDisposedException
, so no existing code would be broken, but people could start writing new, broken code.Related: npgsql/npgsql#1649, #1264.
The text was updated successfully, but these errors were encountered: