Req #31021 [Asn->Csd]: pg_result_notice() is needed to get all notice messages.
| From: | yohgaki@php.net | Date: | Wed, 16 Dec 2015 22:36:40 +0000 |
| Subject: | Req #31021 [Asn->Csd]: pg_result_notice() is needed to get all notice messages. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-197943@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=31021&edit=1
ID: 31021
Updated by: yohgaki@php.net
Reported by: ppo at beeznest dot net
Summary: pg_result_notice() is needed to get all notice
messages.
-Status: Assigned
+Status: Closed
Type: Feature/Change Request
Package: PostgreSQL related
PHP Version: Irrelevant
Assigned To: yohgaki
Block user comment: N
Private report: N
New Comment:
Implemented.
http://git.php.net/?p=php-src.git;a=commitdiff;h=57d9da879043a2f5fc5f29cb469de8bbbf23f26f
Previous Comments:
------------------------------------------------------------------------
[2013-06-26 21:47:44] yohgaki@php.net
Currently, only the last notice message is stored by pgsql module.
/* {{{ _php_pgsql_notice_handler
*/
static void _php_pgsql_notice_handler(void *resource_id, const char *message)
{
php_pgsql_notice *notice;
TSRMLS_FETCH();
if (! PGG(ignore_notices)) {
notice = (php_pgsql_notice *)emalloc(sizeof(php_pgsql_notice));
notice->message = _php_pgsql_trim_message(message, (int
*)¬ice->len);
if (PGG(log_notices)) {
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "%s", notice-
>message);
}
zend_hash_index_update(&PGG(notices), (ulong)resource_id, (void
**)¬ice, sizeof(php_pgsql_notice *), NULL);
}
}
/* }}} */
Nested hash for notices is required.
------------------------------------------------------------------------
[2004-12-08 15:00:47] ppo at beeznest dot net
No, I mean
mixed pg_result_notice(resource result)
returning a string if one notice message and an array if several ones.
------------------------------------------------------------------------
[2004-12-08 14:52:35] tony2001@php.net
pg_last_notice() - is that what you need ?
------------------------------------------------------------------------
[2004-12-08 14:44:42] ppo at beeznest dot net
Description:
------------
Hi,
having the equivalent of pg_result_error for notice messages would be great.
There is also a problem if a query raises several notice messages. Could it be possible to return an
array instead of a string, at least if there are several ones?
Thanks,
Pascal
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=31021&edit=1