Skip to content

Commit

Permalink
Merge pull request rails#11762 from peterkovacs/patch-2
Browse files Browse the repository at this point in the history
Free result_metadata directly instead of freeing 2nd, redundant call.
  • Loading branch information
carlosantoniodasilva committed Aug 5, 2013
2 parents b2d7078 + 76a58e1 commit 03eae19
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Expand Down

0 comments on commit 03eae19

Please sign in to comment.