according to PHP 8.4 upgrading file, 2006 will be changed to 4031 for MySQL 8.0.24+

This commit is contained in:
ralf 2024-09-23 10:32:01 +02:00
parent 3443fa82b2
commit 7e1b318bbc

View File

@ -817,7 +817,7 @@ class Db
}
// PHP 8.1 mysqli throws its own exception
catch(\mysqli_sql_exception $e) {
if (!($reconnect && $this->Type == 'mysql' && ($e->getCode() == 2006 || $e->getMessage() === 'MySQL server has gone away')))
if (!($reconnect && $this->Type == 'mysql' && (in_array($e->getCode(), [2006, 4031]) || $e->getMessage() === 'MySQL server has gone away')))
{
if (in_array($e->getCode(), [
1064, // You have an error in your SQL syntax