diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index cbed6b7db18e..66f09382fc32 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -172,6 +172,7 @@ static void pgsql_link_free(pgsql_link_handle *link) PQclear(res); } if (!link->persistent) { + PQuntrace(link->conn); PQfinish(link->conn); } PGG(num_links)--; diff --git a/ext/pgsql/tests/pg_trace.phpt b/ext/pgsql/tests/pg_trace.phpt new file mode 100644 index 000000000000..89b6027f854e --- /dev/null +++ b/ext/pgsql/tests/pg_trace.phpt @@ -0,0 +1,20 @@ +--TEST-- +pg_trace +--EXTENSIONS-- +pgsql +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(true)