rdbms: Issue a deprecation warning if errors are ignored
authorBrad Jorsch <bjorsch@wikimedia.org>
Thu, 5 Apr 2018 18:17:09 +0000 (14:17 -0400)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 10 Apr 2018 02:06:44 +0000 (02:06 +0000)
commit0618227f7f2303a883f5c2b351647f550c345ba0
treea0ee41436cb040c14fff82609d9a4d923f188e5f
parent1ce52c41fcef3cb6fc8dba10ad3a6d570373d8bd
rdbms: Issue a deprecation warning if errors are ignored

I532bc5201 added code to put the Database into an error state on error,
to prevent callers from catching and ignoring exceptions without rolling
back. But to avoid breaking everything relying on the ability to do so,
it didn't set the error state for certain types of errors.

To allow those broken callers to be cleaned up, log a deprecation
warning when we detect that someone has indeed ignored one of these
errors.

Bug: T189999
Change-Id: Ib7aca59639f30959e106fd4f1a1209e28bad2857
includes/libs/rdbms/database/Database.php
tests/phpunit/includes/db/DatabaseTestHelper.php
tests/phpunit/includes/libs/rdbms/database/DatabaseSQLTest.php