From 349c83393c96260d6afcec6be7c30a0eacde0196 Mon Sep 17 00:00:00 2001 From: Matteo Beccati Date: Mon, 22 Jul 2024 12:16:06 +0200 Subject: [PATCH] Properly handle MySQL error code 4031 from PHP 8.4 (#6363) | Q | A |------------- | ----------- | Type | improvement | Fixed issues | Prevents future issues ;-) #### Summary PHP 8.4 will support a new error code 4031 in mysqlnd when the connection is dropped due to timeouts. It has been introduced in: https://github.com/mysql/mysql-server/commit/14508bbb1790697c28659dd051fbc855cd3b5da9 And PHP 8.4 will support it: https://github.com/php/php-src/pull/13618 The PR gets the test suite green again (mysqli + pdo_mysql). I have used 4.0.x as base, but feel free to change according to your preferences. --- src/Driver/API/MySQL/ExceptionConverter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Driver/API/MySQL/ExceptionConverter.php b/src/Driver/API/MySQL/ExceptionConverter.php index 87d50aff9e3..fdfc75a77fd 100644 --- a/src/Driver/API/MySQL/ExceptionConverter.php +++ b/src/Driver/API/MySQL/ExceptionConverter.php @@ -101,6 +101,7 @@ public function convert(Exception $exception, ?Query $query): DriverException return new ConnectionException($exception, $query); case 2006: + case 4031: return new ConnectionLost($exception, $query); case 1048: