X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FStorage%2FNameTableStore.php;h=88f301aee9c118c4328c88dab66668941928b96f;hb=fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6;hp=5ef03042dc9a96125847f809f1ab63f9263a3220;hpb=22ac82f4cd7960735339d23865fce21665ea9c17;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Storage/NameTableStore.php b/includes/Storage/NameTableStore.php index 5ef03042dc..88f301aee9 100644 --- a/includes/Storage/NameTableStore.php +++ b/includes/Storage/NameTableStore.php @@ -111,7 +111,7 @@ class NameTableStore { * @return IDatabase */ private function getDBConnection( $index, $flags = 0 ) { - return $this->loadBalancer->getConnection( $index, [], $this->domain, $flags ); + return $this->loadBalancer->getConnectionRef( $index, [], $this->domain, $flags ); } /** @@ -160,10 +160,7 @@ class NameTableStore { if ( $id === null ) { // RACE: $name was already in the db, probably just inserted, so load from master. // Use DBO_TRX to avoid missing inserts due to other threads or REPEATABLE-READs. - // ...but not during unit tests, because we need the fake DB tables of the default - // connection. - $connFlags = defined( 'MW_PHPUNIT_TEST' ) ? 0 : ILoadBalancer::CONN_TRX_AUTOCOMMIT; - $table = $this->reloadMap( $connFlags ); + $table = $this->reloadMap( ILoadBalancer::CONN_TRX_AUTOCOMMIT ); $searchResult = array_search( $name, $table, true ); if ( $searchResult === false ) {