Skip to content

Commit 868e675

Browse files
committedFeb 6, 2020
Fix and test ConninfoParseError
1 parent 1ee5574 commit 868e675

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎src/connections.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ function conninfo(str::AbstractString)
744744
if err_ref[] != C_NULL
745745
err_msg = unsafe_string(err_ref[])
746746
libpq_c.PQfreemem(err_ref[])
747-
error(LOGGER, ConninfoParseError(err_msg))
747+
error(LOGGER, Errors.ConninfoParseError(err_msg))
748748
end
749749

750750
ci_array = conninfo(ci_ptr)

‎test/runtests.jl

+3
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,9 @@ end
443443
results = columntable(execute(conn, "SELECT '1 12:59:10'::interval;"))
444444
@test results[1][1] == "@ 1 day 12 hours 59 mins 10 secs"
445445
close(conn)
446+
447+
# ERROR: missing "=" after "barf" in connection info string
448+
@test_throws LibPQ.Errors.ConninfoParseError LibPQ.conninfo("wrong")
446449
end
447450

448451
@testset "Time Zone" begin

0 commit comments

Comments
 (0)
Please sign in to comment.