From 24a19cc232668b5b839932a120d663b903729777 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 26 Nov 2020 12:30:17 +0100 Subject: Suppress stream errors in mysqlnd mysqlnd currently sets error_reporting=0 to suppress errors while writing to streams. Unfortunately these errors are still visible to userland error handlers, which is a source of confusion. See for example https://bugs.php.net/bug.php?id=80412. Instead add a stream flag that suppresses the emission of read/write errors in the first place, and set it in mysqlnd. I think it might be useful to have this option for userland as well in the future, but for now this is just an internal mechanism. Closes GH-6458. --- main/php_streams.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main/php_streams.h') diff --git a/main/php_streams.h b/main/php_streams.h index 73740a7a79..6d6c73bb95 100644 --- a/main/php_streams.h +++ b/main/php_streams.h @@ -181,6 +181,10 @@ struct _php_stream_wrapper { #define PHP_STREAM_FLAG_NO_FCLOSE 0x80 +/* Suppress generation of PHP warnings on stream read/write errors. + * Currently for internal use only. */ +#define PHP_STREAM_FLAG_SUPPRESS_ERRORS 0x100 + #define PHP_STREAM_FLAG_WAS_WRITTEN 0x80000000 struct _php_stream { -- cgit v1.2.1