1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/pgsql/tests/pg_trace.phpt
David CARLIER f194cdf852 ext/pgsql: fix PGtrace invalid free issue.
disable trace when closing the connection, is a no op if there is no stream
attached to it.

Close GH-11403
2023-06-18 13:44:39 +01:00

27 lines
444 B
PHP

--TEST--
pg_trace
--EXTENSIONS--
pgsql
--SKIPIF--
<?php include("skipif.inc"); ?>
--FILE--
<?php
include('config.inc');
$db = pg_connect($conn_str);
$tracefile = __DIR__ . '/trace.tmp';
try {
pg_trace($tracefile, 'w', $db, 56432);
} catch (ValueError $e) {
echo $e->getMessage() . PHP_EOL;
}
var_dump(pg_trace($tracefile, 'w', $db, 0));
$res = pg_query($db, 'select 1');
?>
--EXPECTF--
pg_trace(): Argument #4 ($trace_mode) %s
bool(true)