Skip to content

Commit

Permalink
Properly handle MySQL error code 4031 from PHP 8.4 (#6363)
Browse files Browse the repository at this point in the history
|      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:

mysql/mysql-server@14508bb

And PHP 8.4 will support it:
php/php-src#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.
  • Loading branch information
mbeccati authored Jul 22, 2024
1 parent b35648d commit 349c833
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Driver/API/MySQL/ExceptionConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 349c833

Please sign in to comment.