diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-26 12:30:17 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-11-30 15:06:28 +0100 |
commit | 24a19cc232668b5b839932a120d663b903729777 (patch) | |
tree | 25904cc1dfea23deedfca9b3abbbc73c48dc459d /ext/mysqlnd/mysqlnd_vio.c | |
parent | a0baa09b99adf4f65792e26a8af461a8fa4c97dc (diff) | |
download | php-git-24a19cc232668b5b839932a120d663b903729777.tar.gz |
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.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_vio.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_vio.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_vio.c b/ext/mysqlnd/mysqlnd_vio.c index bc59cbeed8..e33761f278 100644 --- a/ext/mysqlnd/mysqlnd_vio.c +++ b/ext/mysqlnd/mysqlnd_vio.c @@ -263,6 +263,7 @@ MYSQLND_METHOD(mysqlnd_vio, post_connect_set_opt)(MYSQLND_VIO * const vio, const } net_stream->chunk_size = vio->data->options.net_read_buffer_size; + net_stream->flags |= PHP_STREAM_FLAG_SUPPRESS_ERRORS; } DBG_VOID_RETURN; |