Skip to content
Browse files

accept new invalid_password error code added in 9.0

  • Loading branch information...
1 parent 912ba75 commit 8f5de83d955cdabbe0db2c7b357c3b5353636ec7 @wg committed Jun 6, 2010
Showing with 16 additions and 3 deletions.
  1. +1 −0 src/pgsql_connection.erl
  2. +15 −3 test_src/pgsql_tests.erl
View
1 src/pgsql_connection.erl
@@ -159,6 +159,7 @@ auth({$R, <<M:?int32, _/binary>>}, State) ->
auth({error, E}, State) ->
case E#error.code of
<<"28000">> -> Why = invalid_authorization_specification;
+ <<"28P01">> -> Why = invalid_password;
Any -> Why = Any
end,
gen_fsm:reply(State#state.reply_to, {error, Why}),
View
18 test_src/pgsql_tests.erl
@@ -28,13 +28,25 @@ connect_with_md5_test() ->
"epgsql_test_md5",
[{database, "epgsql_test_db1"}]]).
-connect_with_invalid_password_test() ->
+connect_with_invalid_user_test() ->
{error, invalid_authorization_specification} =
pgsql:connect(?host,
- "epgsql_test_md5",
- "epgsql_test_sha1",
+ "epgsql_test_invalid",
+ "epgsql_test_invalid",
[{port, ?port}, {database, "epgsql_test_db1"}]).
+connect_with_invalid_password_test() ->
+ {error, Why} =
+ pgsql:connect(?host,
+ "epgsql_test_md5",
+ "epgsql_test_invalid",
+ [{port, ?port}, {database, "epgsql_test_db1"}]),
+ case Why of
+ invalid_authorization_specification -> ok; % =< 8.4
+ invalid_password -> ok % >= 9.0
+ end.
+
+
connect_with_ssl_test() ->
lists:foreach(fun application:start/1, [crypto, ssl]),
with_connection(

0 comments on commit 8f5de83

Please sign in to comment.
Something went wrong with that request. Please try again.