New installation blocked when checking if the DB exists,
because when select DB, if it fails, it will throw an exception.
So I modify the checking logic to determine if there is an exception
thrown instead of detecting the return value.
Bug: T215566
Change-Id: I6817997434df7adc79fbc1b224b77c0daa8cc11d
=== Bug fixes in 1.33 ===
* (T164211) Special:UserRights could sometimes fail with a
"conflict detected" error when there weren't any conflicts.
+* (T215566) Unable to determine if the database exists
+ during a fresh installation.
=== Action API changes in 1.33 ===
* (T198913) Added 'ApiOptions' hook.
use Wikimedia\Rdbms\LBFactorySingle;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\DBExpectedError;
+use Wikimedia\Rdbms\DBConnectionError;
/**
* Base class for DBMS-specific installation helper classes.
return false;
}
- if ( !$this->db->selectDB( $this->getVar( 'wgDBname' ) ) ) {
+ try {
+ $this->db->selectDB( $this->getVar( 'wgDBname' ) );
+ } catch ( DBConnectionError $e ) {
+ // Don't catch DBConnectionError
+ throw $e;
+ } catch ( DBExpectedError $e ) {
return false;
}