Permalink
Browse files

Merge pull request #11762 from peterkovacs/patch-2

Free result_metadata directly instead of freeing 2nd, redundant call.
  • Loading branch information...
2 parents b2d7078 + 76a58e1 commit 03eae19e4d2f1ea1975af79668859c3a9533fa6d @carlosantoniodasilva carlosantoniodasilva committed Aug 5, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -507,12 +507,12 @@ def exec_stmt(sql, name, binds)
cols = cache[:cols] ||= metadata.fetch_fields.map { |field|
field.name
}
+ metadata.free
end
result_set = ActiveRecord::Result.new(cols, stmt.to_a) if cols
affected_rows = stmt.affected_rows
- stmt.result_metadata.free if cols
stmt.free_result
stmt.close if binds.empty?

0 comments on commit 03eae19

Please sign in to comment.