Closed cfinke closed 2 years ago
In PHP 8.1, the default error mode for mysqli is set to MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT. This causes errors to raise exceptions rather than be silenced, as explained in https://php.watch/versions/8.1/mysqli-error-mode
MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT
The wpdb class already resets this (https://github.com/WordPress/wordpress-develop/blob/5.9/src/wp-includes/wp-db.php#L1724); should HyperDB reset it also?
wpdb
My assumption is that after $this->use_mysqli = $this->should_use_mysqli(); in __construct(), the following could be added:
$this->use_mysqli = $this->should_use_mysqli();
__construct()
if ( $this->use_mysqli ) { mysqli_report( MYSQLI_REPORT_OFF ); }
At least for the project I'm using HyperDB on, this fixes the issue with mysqli exceptions being raised and ending scripts.
In PHP 8.1, the default error mode for mysqli is set to
MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT
. This causes errors to raise exceptions rather than be silenced, as explained in https://php.watch/versions/8.1/mysqli-error-modeThe
wpdb
class already resets this (https://github.com/WordPress/wordpress-develop/blob/5.9/src/wp-includes/wp-db.php#L1724); should HyperDB reset it also?My assumption is that after
$this->use_mysqli = $this->should_use_mysqli();
in__construct()
, the following could be added:At least for the project I'm using HyperDB on, this fixes the issue with mysqli exceptions being raised and ending scripts.