diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-11-13 15:31:54 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-11-13 15:31:54 -0800 |
commit | aeb917d475dfccb8b5f3b5a57f62df5358ad3ef0 (patch) | |
tree | 04640968ba44bbb4914700746d52c37bf9bbcf02 /activerecord | |
parent | 25e1e8cd7503c4236b519b5e203336976fb71303 (diff) | |
download | rails-aeb917d475dfccb8b5f3b5a57f62df5358ad3ef0.tar.gz rails-aeb917d475dfccb8b5f3b5a57f62df5358ad3ef0.tar.bz2 rails-aeb917d475dfccb8b5f3b5a57f62df5358ad3ef0.zip |
exec_prepared is GVL friendly, so lets use it.
also increase the version of pg required so that people will get the
GVL friendly version
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 9941f74766..6310d70192 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -13,7 +13,7 @@ require 'active_record/connection_adapters/postgresql/database_statements' require 'arel/visitors/bind_visitor' # Make sure we're using pg high enough for PGResult#values -gem 'pg', '~> 0.11' +gem 'pg', '~> 0.15' require 'pg' require 'ipaddr' @@ -596,9 +596,7 @@ module ActiveRecord } log(sql, name, type_casted_binds, stmt_key) do - @connection.send_query_prepared(stmt_key, type_casted_binds.map { |_, val| val }) - @connection.block - @connection.get_last_result + @connection.exec_prepared(stmt_key, type_casted_binds.map { |_, val| val }) end rescue ActiveRecord::StatementInvalid => e pgerror = e.original_exception |