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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 - 20 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Mar 29 12:01:27 2024 UTC