mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge branch 'move_mysql2_out_of_abstract_adapter'
This commit is contained in:
commit
520111096f
2 changed files with 9 additions and 5 deletions
|
@ -623,11 +623,7 @@ module ActiveRecord
|
|||
when ER_QUERY_INTERRUPTED
|
||||
QueryCanceled.new(message, sql: sql, binds: binds)
|
||||
else
|
||||
if exception.is_a?(Mysql2::Error::TimeoutError)
|
||||
ActiveRecord::AdapterTimeout.new(message, sql: sql, binds: binds)
|
||||
else
|
||||
super
|
||||
end
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -140,6 +140,14 @@ module ActiveRecord
|
|||
def get_full_version
|
||||
@connection.server_info[:version]
|
||||
end
|
||||
|
||||
def translate_exception(exception, message:, sql:, binds:)
|
||||
if exception.is_a?(Mysql2::Error::TimeoutError) && !exception.error_number
|
||||
ActiveRecord::AdapterTimeout.new(message, sql: sql, binds: binds)
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue