1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
--TEST--
GH-10672 (pg_lo_open segfaults in the strict_types mode)
--EXTENSIONS--
pgsql
--SKIPIF--
<?php
include("inc/skipif.inc");
?>
--FILE--
<?php
declare(strict_types=1);
include "inc/config.inc";
$table_name = 'table_gh10672';
$db = pg_connect($conn_str);
pg_query($db, "CREATE TABLE {$table_name} (bar text);");
// Begin a transaction
pg_query($db, 'BEGIN');
// Create an empty large object
$oid = pg_lo_create($db);
if ($oid === false) {
die(pg_last_error($db));
}
// Open the large object for writing
$lob = pg_lo_open($db, $oid, 'w');
if ($oid === false) {
die(pg_last_error($db));
}
echo 'The large object has been opened successfully.', PHP_EOL;
?>
--CLEAN--
<?php
require_once('inc/config.inc');
$table_name = 'table_gh10672';
$dbh = pg_connect($conn_str);
pg_query($dbh, "DROP TABLE IF EXISTS {$table_name}");
?>
--EXPECT--
The large object has been opened successfully.
|