-
Bug
-
Resolution: Fixed
-
Minor
-
4.1
-
MOODLE_401_STABLE
-
MOODLE_401_STABLE
-
Before PHP 8.1, the mysqli extension had MYSQLI_REPORT_OFF as default setting.
With PHP 8.1, it has been changed to MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT
The default error handling mode has been changed from "silent" to
"exceptions". See https://www.php.net/manual/en/mysqli-driver.report-mode.php
for details of behavior changes and how to explicitly set this attribute. To
keep the old behavior, use mysqli_report(MYSQLI_REPORT_OFF);
RFC: https://wiki.php.net/rfc/mysqli_default_errmode
That implies that now, instead of just returning null or false, some methods are effectively throwing exceptions instead.
Problem is that our mysqli native driver is not ready to handle those exceptions, hence the plan is:
- In this issue, part of the PHP 8.1 epic, set the extension back to MYSQLI_REPORT_OFF.
- In another issue, apart from the PHP 8.1 epic (MDL-75761), analyse the possibility of modernising our mysql native driver to get advantage of exceptions handling and so on.
Of course, we'll need to verify both mysql and children drivers (mariadb, auroramysql).
Ciao