aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorPeter Kovacs <peter@kovax.org>2013-08-05 11:44:16 -0400
committerPeter Kovacs <peter@kovax.org>2013-08-05 11:44:16 -0400
commit76a58e1e7e10d71ac47aa2a17e6436aca1b506fb (patch)
tree7acacbf0dec4f05baba72ba6bd1088022fa41ac8 /activerecord/lib
parent3baee0982d25e64cab2eeb046369f0fcf9ee2436 (diff)
downloadrails-76a58e1e7e10d71ac47aa2a17e6436aca1b506fb.tar.gz
rails-76a58e1e7e10d71ac47aa2a17e6436aca1b506fb.tar.bz2
rails-76a58e1e7e10d71ac47aa2a17e6436aca1b506fb.zip
Free result_metadata directly instead of freeing 2nd, redundant call.
`result_metadata` returns a new object each time it is called, so calling `result_metadata.free` is essentially a noop. Instead call `free` directly on the metadata when we're done with it.
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql_adapter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index 1826d88500..fbe6ecf5f1 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -507,12 +507,12 @@ module ActiveRecord
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?