From 1741bbe2d5cb58af76fb2ca31a25c05eadfadb71 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 21 Oct 2010 11:19:45 -0700 Subject: avoiding statement cache if there are no bind values --- .../cases/adapters/postgresql/schema_authorization_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activerecord/test/cases/adapters/postgresql') diff --git a/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb b/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb index 6f372edc38..8fdda20f77 100644 --- a/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb +++ b/activerecord/test/cases/adapters/postgresql/schema_authorization_test.rb @@ -43,6 +43,18 @@ class SchemaAuthorizationTest < ActiveRecord::TestCase end end + def test_auth_with_bind + assert_nothing_raised do + set_session_auth + USERS.each do |u| + @connection.clear_cache! + set_session_auth u + assert_equal u, @connection.exec("SELECT name FROM #{TABLE_NAME} WHERE id = $1", 'SQL', [[nil, 1]]).first['name'] + set_session_auth + end + end + end + def test_schema_uniqueness assert_nothing_raised do set_session_auth -- cgit v1.2.3