We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3de2ce commit 7139c84Copy full SHA for 7139c84
ext/pgsql/pgsql.c
@@ -328,6 +328,10 @@ static void _close_pgsql_plink(zend_resource *rsrc)
328
329
static void _php_pgsql_notice_handler(void *l, const char *message)
330
{
331
+ if (l == NULL) {
332
+ /* This connection does not currently have a valid context, ignore this notice */
333
+ return;
334
+ }
335
if (PGG(ignore_notices)) {
336
return;
337
}
@@ -360,6 +364,9 @@ static int _rollback_transactions(zval *el)
360
364
361
365
link = (PGconn *) rsrc->ptr;
362
366
367
+ /* unset notice processor */
368
+ PQsetNoticeProcessor(link, _php_pgsql_notice_handler, NULL);
369
+
363
370
if (PQsetnonblocking(link, 0)) {
371
php_error_docref("ref.pgsql", E_NOTICE, "Cannot set connection to blocking mode");
372
return -1;
0 commit comments