Skip to content

Commit bc45b34

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
2 parents bb3e5a8 + f194cdf commit bc45b34

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ PHP NEWS
5454
- PCRE:
5555
. Fix preg_replace_callback_array() pattern validation. (ilutov)
5656

57+
- PGSQL:
58+
. Fixed intermittent segfault with pg_trace. (David Carlier)
59+
5760
- Phar:
5861
. Fix cross-compilation check in phar generation for FreeBSD. (peter279k)
5962

ext/pgsql/pgsql.c

+1
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ static void pgsql_link_free(pgsql_link_handle *link)
175175
PQclear(res);
176176
}
177177
if (!link->persistent) {
178+
PQuntrace(link->conn);
178179
PQfinish(link->conn);
179180
}
180181
PGG(num_links)--;

ext/pgsql/tests/pg_trace.phpt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
pg_trace
3+
--EXTENSIONS--
4+
pgsql
5+
--SKIPIF--
6+
<?php include("skipif.inc"); ?>
7+
--FILE--
8+
<?php
9+
10+
include('config.inc');
11+
12+
$db = pg_connect($conn_str);
13+
$tracefile = __DIR__ . '/trace.tmp';
14+
15+
var_dump(pg_trace($tracefile, 'w', $db));
16+
$res = pg_query($db, 'select 1');
17+
18+
?>
19+
--EXPECTF--
20+
bool(true)

0 commit comments

Comments
 (0)