diff --git a/lib/active_record/connection_adapters/mysql2_adapter.rb b/lib/active_record/connection_adapters/mysql2_adapter.rb index 2879368..a47756f 100644 --- a/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -243,10 +243,12 @@ module ActiveRecord end def disconnect! + @connection.close @connection = nil end def reset! + disconnect! @connection = Mysql2::Client.new(@config) end diff --git a/lib/sequel/adapters/mysql2.rb b/lib/sequel/adapters/mysql2.rb index 9946f05..a43068f 100644 --- a/lib/sequel/adapters/mysql2.rb +++ b/lib/sequel/adapters/mysql2.rb @@ -150,7 +150,7 @@ module Sequel # Closes given database connection. def disconnect_connection(c) - c = nil + c.close end # Convert tinyint(1) type to boolean if convert_tinyint_to_bool is true