diff --git a/NEWS b/NEWS index e58dcd9aa10..de9432558ae 100644 --- a/NEWS +++ b/NEWS @@ -54,6 +54,9 @@ PHP NEWS - PCRE: . Fix preg_replace_callback_array() pattern validation. (ilutov) +- PGSQL: + . Fixed intermittent segfault with pg_trace. (David Carlier) + - Phar: . Fix cross-compilation check in phar generation for FreeBSD. (peter279k) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 188570f7cea..a1dc8fc63bd 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -175,6 +175,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 00000000000..89b6027f854 --- /dev/null +++ b/ext/pgsql/tests/pg_trace.phpt @@ -0,0 +1,20 @@ +--TEST-- +pg_trace +--EXTENSIONS-- +pgsql +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(true)