Permalink
Browse files

Merge branch 'master' into adequaterecord

* master:
  fix exception translation
  translate exceptions on prepared statement failure
  test to ensure bad prepared statements raise a StatementInvalid exception
  • Loading branch information...
2 parents 15ff426 + 1543863 commit 5ac2879b08b05b7f6eaebc5473e62b4576f84a3f @tenderlove tenderlove committed Jan 17, 2014
Showing with 6 additions and 0 deletions.
  1. +6 −0 activerecord/test/cases/adapters/postgresql/schema_test.rb
@@ -115,6 +115,12 @@ def test_raise_drop_schema_with_nonexisting_schema
end
end
+ def test_raise_wraped_exception_on_bad_prepare
+ assert_raises(ActiveRecord::StatementInvalid) do
+ @connection.exec_query "select * from developers where id = ?", 'sql', [[nil, 1]]
+ end
+ end
+
def test_schema_change_with_prepared_stmt
altered = false
@connection.exec_query "select * from developers where id = $1", 'sql', [[nil, 1]]

0 comments on commit 5ac2879

Please sign in to comment.