cvs: php4 /ext/pgsql pgsql.c

From: Date: Tue, 13 Feb 2001 20:13:15 +0000
Subject: cvs: php4 /ext/pgsql pgsql.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-4011@lists.php.net to get a copy of this message
thies Tue Feb 13 12:13:15 2001 EDT Modified files: /php4/ext/pgsql pgsql.c Log: remove stupid PGSQL warning Index: php4/ext/pgsql/pgsql.c diff -u php4/ext/pgsql/pgsql.c:1.87 php4/ext/pgsql/pgsql.c:1.88 --- php4/ext/pgsql/pgsql.c:1.87 Tue Feb 13 10:28:24 2001 +++ php4/ext/pgsql/pgsql.c Tue Feb 13 12:13:14 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.87 2001/02/13 18:28:24 thies Exp $ */ +/* $Id: pgsql.c,v 1.88 2001/02/13 20:13:14 thies Exp $ */ #include <stdlib.h> @@ -145,25 +145,23 @@ 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; }

« previous php.cvs (#4011) next »