Skip to content
This repository
Browse code

Merge pull request #11762 from peterkovacs/patch-2

Free result_metadata directly instead of freeing 2nd, redundant call.
  • Loading branch information...
commit 45764ad53cf84dce9278776edafcf8373bb809a0 1 parent 046d52b
Carlos Antonio da Silva carlosantoniodasilva authored
2  activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -507,12 +507,12 @@ def exec_stmt(sql, name, binds)
507 507 cols = cache[:cols] ||= metadata.fetch_fields.map { |field|
508 508 field.name
509 509 }
  510 + metadata.free
510 511 end
511 512
512 513 result_set = ActiveRecord::Result.new(cols, stmt.to_a) if cols
513 514 affected_rows = stmt.affected_rows
514 515
515   - stmt.result_metadata.free if cols
516 516 stmt.free_result
517 517 stmt.close if binds.empty?
518 518

0 comments on commit 45764ad

Please sign in to comment.
Something went wrong with that request. Please try again.