Dylan Wagstaff 8c3ba81052
FIX PHP 8.1 support in MySQLiConnector::query errors (#10570)
* FIX PHP 8.1 support in MySQLiConnector::query errors

The default error reporting mode in PHP 8.1 has changed from using
errors reported on the connection handle to throwing
mysqli_sql_exception. query() makes no allowance for this, and
functions up the call stack expect to catch
Silverstripe\ORM\Connect\DatabaseException instead - resulting in the
MySQLi exception going all the way up to halt the system.

We can use a try, catch, and finally to retain backwards compatibility,
no matter which setting (e.g. PHP version default) someone has enabled.

* Move MySQLConnector test skip call into setUp()

As review feedback; marking the test as skipped in a private function
obfuscated where the call was happening and made it harder to skimread
the tests. Moving this into a setUp function makes it obvious the check
is run before each test case, and skipped if necessary.
2023-07-07 15:56:31 +12:00
..
2022-05-13 12:11:18 +12:00
2022-04-14 13:12:59 +12:00
2022-05-19 14:09:04 +12:00
2022-04-14 13:12:59 +12:00
2021-07-06 16:43:54 +12:00
2022-04-14 13:12:59 +12:00
2016-11-23 19:25:12 +13:00
2018-01-16 18:39:30 +00:00
2022-04-14 13:12:59 +12:00
2022-04-14 13:12:59 +12:00
2022-04-14 13:12:59 +12:00
2022-04-14 13:12:59 +12:00