From: [EMAIL PROTECTED]
Operating system: Win2000
PHP version: 4.3.2
PHP Bug Type: PostgreSQL related
Bug description: pg_lo_open() doesn't return a valid result ressource
Description:
------------
pg_lo_open() doesn't return a result ressource in php 4.3.2 whereas the
same script runs properly with PHP 4.3.1
Reproduce code:
---------------
<?php
include("lo_lib.php");
$sql = "select * from bilder";
$res = pg_query($sql);
$rows = pg_numrows($res);
for ($i=0;$i<$rows;$i++) {
$zeile = pg_fetch_array($res,$i);
echo 'Dateigroesse: '.$zeile["size"];
pg_query("begin");
$handle = pg_lo_open($zeile["bild"], "r"); echo '<br>handle =
'.$handle.'<br>';
if ($handle) {
$data = pg_loread($handle, 50000);
$len = strlen($data);
echo ' | gelesen: '.$len.' Bytes';
}
pg_loclose($handle);
pg_exec("commit");
...
Expected result:
----------------
Dateigroesse: 6038
handle = Resource id #6
| gelesen: 6038 Bytes | geschrieben: 6038 Bytes
This is the result from PHP 4.3.1
Actual result:
--------------
Dateigroesse: 6038
handle =
Warning: pg_loclose(): supplied argument is not a valid PostgreSQL large
object resource in c:\apache\htdocs\lotest\bildtest.php on line 19
This is the result from PHP 4.3.2
--
Edit bug report at http://bugs.php.net/?id=24804&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=24804&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=24804&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=24804&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=24804&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24804&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=24804&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=24804&r=support
Expected behavior: http://bugs.php.net/fix.php?id=24804&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=24804&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=24804&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=24804&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24804&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=24804&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=24804&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=24804&r=gnused