diff options
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 8 |
1 files changed, 4 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 9a13d10ecc..158a0573dd 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -772,12 +772,10 @@ module ActiveRecord end def exec_cache(sql, name, binds) - stmt_key = prepare_statement(sql) - log(sql, name, binds) do begin - # Clear the queue - @connection.get_last_result + stmt_key = prepare_statement(sql) + @connection.send_query_prepared(stmt_key, binds.map { |col, val| type_cast(val, col) }) @@ -816,6 +814,8 @@ module ActiveRecord unless @statements.key? sql_key nextkey = @statements.next_key @connection.prepare nextkey, sql + # Clear the queue + @connection.get_last_result @statements[sql_key] = nextkey end @statements[sql_key] |