mysql2
mysql2 copied to clipboard
Exceptions raised while streaming results do not have an error_number
Steps to Reproduce
- Have a query that will take a nontrivial amount of time to send results from the server to the client
- e.g.
select x.column_name, y.table_name from information_schema.columns x cross join information_schema.tables y
- e.g.
- Run the query with streaming
- e.g.
ActiveRecord::Base.connection.raw_connection.query(sql, stream: true).each {}
- e.g.
- Have the streaming interrupted somehow (e.g. kill the query from the MySQL server side)
- Inspect the resulting exception
Observed Behavior
- The exception has no
error_number
Desired Behavior
- The exception has an
error_number
(in this case it would be 1317), just as if that same case were encountered while not streaming. This allows the calling code to correctly identify what went wrong.
Possibly related to #1065