Skip to content

Commit bc3482d

Browse files
author
foobar
committed
Fixed bug: php#11728. Error message was cleared before outputted in pg_pconnect()
1 parent 5c8035e commit bc3482d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/pgsql/pgsql.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,10 @@ void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
434434
pgsql=PQsetdb(host,port,options,tty,dbname);
435435
}
436436
if (pgsql==NULL || PQstatus(pgsql)==CONNECTION_BAD) {
437+
php_error(E_WARNING,"Unable to connect to PostgreSQL server: %s",PQerrorMessage(pgsql));
437438
if (pgsql) {
438439
PQfinish(pgsql);
439440
}
440-
php_error(E_WARNING,"Unable to connect to PostgreSQL server: %s",PQerrorMessage(pgsql));
441441
efree(hashed_details);
442442
RETURN_FALSE;
443443
}

0 commit comments

Comments
 (0)