aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-15 16:15:58 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-26 13:44:09 -0700
commite2813479f96e6dbfcfcde667797298611a9c9311 (patch)
tree8814a7b6eb7eb0e32efab5aca71fed871d748e5e /activerecord/test
parentffb999125a60cbdcee2e6709df019d55f21b22a6 (diff)
downloadrails-e2813479f96e6dbfcfcde667797298611a9c9311.tar.gz
rails-e2813479f96e6dbfcfcde667797298611a9c9311.tar.bz2
rails-e2813479f96e6dbfcfcde667797298611a9c9311.zip
basic bind parameters are working
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
index a61482256a..0b295c9613 100644
--- a/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/postgresql_adapter_test.rb
@@ -29,6 +29,18 @@ module ActiveRecord
assert_equal [['1', 'foo']], result.rows
end
+
+ def test_exec_with_binds
+ string = @connection.quote('foo')
+ @connection.exec("INSERT INTO ex (id, data) VALUES (1, #{string})")
+ result = @connection.exec(
+ 'SELECT id, data FROM ex WHERE id = $1', nil, [[nil, 1]])
+
+ assert_equal 1, result.rows.length
+ assert_equal 2, result.columns.length
+
+ assert_equal [['1', 'foo']], result.rows
+ end
end
end
end