mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #32704 from eugeneius/mysql_statement_pool_hash
Save a hash allocation in MySQL statement pool
This commit is contained in:
commit
7391ab4568
2 changed files with 2 additions and 5 deletions
|
@ -44,7 +44,7 @@ module ActiveRecord
|
|||
|
||||
class StatementPool < ConnectionAdapters::StatementPool # :nodoc:
|
||||
private def dealloc(stmt)
|
||||
stmt[:stmt].close
|
||||
stmt.close
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -71,10 +71,7 @@ module ActiveRecord
|
|||
|
||||
log(sql, name, binds, type_casted_binds) do
|
||||
if cache_stmt
|
||||
cache = @statements[sql] ||= {
|
||||
stmt: @connection.prepare(sql)
|
||||
}
|
||||
stmt = cache[:stmt]
|
||||
stmt = @statements[sql] ||= @connection.prepare(sql)
|
||||
else
|
||||
stmt = @connection.prepare(sql)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue