From: Thies C. Arntzen Date: Tue, 13 Feb 2001 20:13:14 +0000 (+0000) Subject: remove stupid PGSQL warning X-Git-Tag: php-4.0.5RC1~297 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9d6f1179385397d25482ad842dc3b98da06cd06f;p=php remove stupid PGSQL warning --- diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index cbc09ba60f..1147323a47 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -145,25 +145,23 @@ static void _close_pgsql_plink(zend_rsrc_list_entry *rsrc) PGG(num_links)--; } +static void _be_quiet(void * arg, const char * message) +{ +} + static int _rollback_transactions(zend_rsrc_list_entry *rsrc) { PGconn *link = (PGconn *)rsrc->ptr; - /* - PGresult *pg_result; - ExecStatusType status; - */ + PQnoticeProcessor old_notice_hook; - PQexec(link,"BEGIN;ROLLBACK;"); + /* we set the PQsetNoticeProcessor to avoid the stupid + * "NOTICE: BEGIN: already a transaction in progress" + * message + */ - /* maybe do error handling later.... - pg_result = PQexec(link,"BEGIN;ROLLBACK;"); - - if (pg_result) { - status = PQresultStatus(pg_result); - } else { - status = (ExecStatusType) PQstatus(link); - } - */ + old_notice_hook = PQsetNoticeProcessor(link, _be_quiet, NULL); + PQexec(link,"BEGIN;ROLLBACK;"); + PQsetNoticeProcessor(link, old_notice_hook, NULL); return 0; }