Closed partikus closed 1 year ago
In PHP 8.1, the default error handling behavior of the MySQLi extension has changed from silencing errors to throw an Exception on errors. MySQLi's default error mode is changed from MYSQLI_REPORT_OFF to MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT
In PHP 8.1, the default error handling behavior of the MySQLi extension has changed from silencing errors to throw an Exception on errors.
MySQLi's default error mode is changed from MYSQLI_REPORT_OFF to MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT
MYSQLI_REPORT_OFF
MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT
https://php.watch/versions/8.1/mysqli-error-mode https://www.php.net/manual/en/class.mysqli-sql-exception.php
There were 2 ways how to solve it:
if (!isset($this->_config['report_mode']) || PHP_VERSION_ID >= 80100) { mysqli_report( isset($this->_config['report_mode']) ? $this->_config['report_mode'] : MYSQLI_REPORT_OFF ); }
I've chosen 2nd option taking inspiration from https://github.com/doctrine/dbal/pull/4875/
After adjusting MySQLi stuff we ended with:
There were 22 incomplete tests: ... There were 591 skipped tests: ...
No errors, failures for PHP 8.1.
Thanks @partikus ! Please adjust the PR title to reflect the issue what it is really addressing. Tests are not being adjusted at all in this PR.
@falkenhawk updated, thank you for your comments 👍
https://php.watch/versions/8.1/mysqli-error-mode https://www.php.net/manual/en/class.mysqli-sql-exception.php
There were 2 ways how to solve it:
MYSQLI_REPORT_OFF
when no special config is givenI've chosen 2nd option taking inspiration from https://github.com/doctrine/dbal/pull/4875/
After adjusting MySQLi stuff we ended with:
No errors, failures for PHP 8.1.