Skip to content

Commit 8b356a9

Browse files
committed
Test binding error
1 parent 403c0b3 commit 8b356a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/query_test.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,12 @@ defmodule QueryTest do
544544
assert [[42]] = query("SELECT 42", [])
545545
end
546546

547+
test "connection works after failure in binding state", context do
548+
assert %Postgrex.Error{postgres: %{code: :invalid_text_representation}} =
549+
query("insert into uniques values (CAST($1::text AS int))", ["invalid"])
550+
assert [[42]] = query("SELECT 42", [])
551+
end
552+
547553
test "connection works after failure in executing state", context do
548554
assert %Postgrex.Error{postgres: %{code: :unique_violation}} =
549555
query("insert into uniques values (1), (1);", [])

0 commit comments

Comments
 (0)