Bug #68199 [Asn->Csd]: PDO::pgsqlGetNotify doesn't support NOTIFY payloads

From: Date: Fri, 17 Oct 2014 14:49:30 +0000
Subject: Bug #68199 [Asn->Csd]: PDO::pgsqlGetNotify doesn't support NOTIFY payloads
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188171@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68199&edit=1 ID: 68199 Updated by: mbeccati@php.net Reported by: alain dot laporte12345 at gmail dot com Summary: PDO::pgsqlGetNotify doesn't support NOTIFY payloads -Status: Assigned +Status: Closed Type: Bug Package: PDO PgSQL PHP Version: 5.6.2 Assigned To: mbeccati Block user comment: N Private report: N New Comment: Automatic comment on behalf of mbeccati Revision: http://git.php.net/?p=php-src.git;a=commit;h=8c5e2e66bcbb6fa24db6515a09be36bb4bbf0860 Log: Fixed bug #68199 (PDO::pgsqlGetNotify doesn't support NOTIFY payloads) Previous Comments: ------------------------------------------------------------------------ [2014-10-17 13:49:00] tyrael@php.net 5.6.2 is already out, but I would be okay to have it fixed in the PHP-5.6 branch (so fixing it in 5.6.3 for example). ------------------------------------------------------------------------ [2014-10-17 13:44:15] mbeccati@php.net Thanks for reporting. I would actually categorize this as a bug, as I've mistakenly left it out when adding pgsqlGetNotify in 5.6.0. I guess it would be safe to try and fix it for 5.6.2 and accordingly update the manual entry. Thoughts? ------------------------------------------------------------------------ [2014-10-17 13:22:38] tyrael@php.net Matteo, any chance you could look into this? ------------------------------------------------------------------------ [2014-10-09 12:54:20] alain dot laporte12345 at gmail dot com Description: ------------ Since PostgreSQL 9.0, NOTIFY command accept a payload => http://www.postgresql.org/docs/9.0/static/sql-notify.html The payload is available in the libpq's structure pgNotify.extra => http://www.postgresql.org/docs/9.0/static/libpq-notify.html This field is available since PostgreSQL 7.4, but is empty until PostgreSQL 9.0 => http://www.postgresql.org/docs/7.4/static/libpq-notify.html I provide a patch for PDO::pgsqlGetNotify() method which work for me. But I doubt which my check about libpq version is comply with the good practice. Test script: --------------- <?php $dsn = 'pgsql:host=localhost;port=5432;dbname=postgres;user=admin;password=toto'; $db = new PDO($dsn); $db->exec('LISTEN event;'); $db->exec('NOTIFY event, \'payload\';'); var_dump($db->pgsqlGetNotify()); ?> Expected result: ---------------- array(6) { [0]=> string(5) "event" [1]=> int(25876) [2]=> string(7) "payload" ["message"]=> string(5) "event" ["pid"]=> int(25876) ["payload"]=> string(7) "payload" } Actual result: -------------- array(4) { [0]=> string(5) "event" [1]=> int(25876) ["message"]=> string(5) "event" ["pid"]=> int(25876) } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68199&edit=1

« previous php.bugs (#188171) next »