Skip to content

Commit 2ee4827

Browse files
committed
Fix phpGH-12763: PGSQL pg_untrace(): Argument php#1 ($connection) must be of type resource or null, PgSql\Connection given.
Expanded test bugGH12763.phpt
1 parent 31c2659 commit 2ee4827

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

ext/pgsql/tests/bugGH12763.phpt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,18 @@ include('config.inc');
1010

1111
$conn = pg_connect($conn_str);
1212

13+
$file_name = tempnam('.', 'trace.log');
14+
pg_trace($file_name, 'w', $conn);
15+
pg_query($conn, 'select 1 as a');
1316
pg_untrace($conn);
14-
echo "OK";
17+
$items = explode("\n", file_get_contents($file_name));
18+
foreach ($items as &$item) {
19+
$item = preg_replace('!^.*?\s!', '', $item);
20+
$item = preg_replace('!^.*?\s!', '', $item);
21+
}
22+
unlink($file_name);
23+
echo md5(implode("\n", $items));
1524

1625
?>
1726
--EXPECT--
18-
OK
27+
487dba3a362f8aa1c4b585cdd87d3f2d

0 commit comments

Comments
 (0)