php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36625 pg_trace() does not work
Submitted: 2006-03-06 05:22 UTC Modified: 2006-03-06 21:17 UTC
From: iakio at mono-space dot net Assigned: helly (profile)
Status: Closed Package: PostgreSQL related
PHP Version: 5.1.2 OS: *
Private report: No CVE-ID: None
 [2006-03-06 05:22 UTC] iakio at mono-space dot net
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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-06 21:17 UTC] helly@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Thanks for the patch and testcase
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 12:01:31 2024 UTC