From: iakio at mono-space dot net
Operating system: Linux
PHP version: 5.1.2
PHP Bug Type: PostgreSQL related
Bug description: pg_trace() does not work
Description:
------------
pg_trace() does not work. See attatched patch.
I don't know what it means, but it was different
from others which calling php_stream_cast()
(e.g. ext/bz2/bz2.c, ext/gd/gd.c).
I'm not good at English. Sorry.
--- pgsql.c.orig 2006-03-06 13:02:21.000000000 +0900
+++ pgsql.c 2006-03-06 13:02:37.000000000 +0900
@@ -2360,7 +2360,7 @@
RETURN_FALSE;
}
- if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO,
(void**)fp, REPORT_ERRORS)) {
+ if (FAILURE == php_stream_cast(stream, PHP_STREAM_AS_STDIO,
(void**)&fp, REPORT_ERRORS)) {
php_stream_close(stream);
RETURN_FALSE;
}
Reproduce code:
---------------
<?php
$conn = pg_connect("");
pg_trace("/home/ishida/trace.log", "w", $conn);
$res = pg_query($conn, "select 1");
pg_close($conn);
?>
Expected result:
----------------
$ cat /home/ishida/trace.log
To backend> Msg Q
To backend> 'select 1'
To backend> Msg complete, length 14
>From backend> T
>From backend (#4)> 33
>From backend (#2)> 1
>From backend> "?column?"
...
Actual result:
--------------
$ cat /home/ishida/trace.log
(empty)
--
Edit bug report at http://bugs.php.net/?id=36625&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36625&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36625&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36625&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36625&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36625&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36625&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36625&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36625&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36625&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36625&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36625&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36625&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36625&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36625&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36625&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36625&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36625&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36625&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36625&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36625&r=mysqlcfg