You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dev: DatabaseException might not be thrown even if query fails #6913
changed the title [-]Dev: DatabaseException may not be thrown if query fails[/-][+]Dev: DatabaseException may not be thrown even if query fails[/+]on Nov 27, 2022
changed the title [-]Dev: DatabaseException may not be thrown even if query fails[/-][+]Dev: DatabaseException might not be thrown even if query fails[/+]on Jan 27, 2024
--- a/app/Config/Boot/testing.php+++ b/app/Config/Boot/testing.php@@ -14,7 +14,7 @@
| make sure they don't make it to production. And save us hours of
| painful debugging.
*/
-error_reporting(E_ALL);+error_reporting(E_ALL & ~E_WARNING);
ini_set('display_errors', '1');
/*
$ vendor/bin/phpunit tests/system/Database/Live/TransactionTest.php PHPUnit 9.6.16 by Sebastian Bergmann and contributors.Runtime: PHP 8.2.15Configuration: /Users/kenji/work/codeigniter/official/CodeIgniter4-4.5/phpunit.xmlF... 4 / 4 (100%)Time: 00:00.231, Memory: 18.00 MBThere was 1 failure:1) CodeIgniter\Database\Live\TransactionTest::testTransStartDBDebugTrueFailed asserting that null is an instance of class "CodeIgniter\Database\Exceptions\DatabaseException"./Users/kenji/work/codeigniter/official/CodeIgniter4-4.5/tests/system/Database/Live/TransactionTest.php:106FAILURES!Tests: 4, Assertions: 14, Failures: 1.
SQLSRV driver has different implementation. It throws Exception when the query return value is false.
This is correct.
SQLite3, Postgres and OCI8 drivers should throw Exception when the query return value is false.
Activity
[-]Dev: DatabaseException may not be thrown if query fails[/-][+]Dev: DatabaseException may not be thrown even if query fails[/+][-]Dev: DatabaseException may not be thrown even if query fails[/-][+]Dev: DatabaseException might not be thrown even if query fails[/+]kenjis commentedon Jan 27, 2024
SQLite3
This is correct.
SQLite3, Postgres and OCI8 drivers should throw Exception when the query return value is false.
style: satisfy Rector for Postgre errors (codeigniter4#6913)
fix: throw Postgre query errors with warnings disabled (codeigniter4#…
style: satisfy Rector for Postgre errors (codeigniter4#6913)
docs: add changelog entry for Postgre query errors (codeigniter4#6913)
fix: throw Postgre query errors with warnings disabled (#10573)