rdbms: override sanitizeConnectionFlags() in LoadBalancerSingle
Change-Id: I1d4ade28762e199f99fe80ae1ff9ef70e74264fe
This commit is contained in:
parent
ccf94e31c1
commit
0cb0f0ba7a
2 changed files with 10 additions and 1 deletions
|
|
@ -313,7 +313,7 @@ class LoadBalancer implements ILoadBalancerForOwner {
|
|||
* @param string $domain Database domain
|
||||
* @return int Sanitized bitfield
|
||||
*/
|
||||
private function sanitizeConnectionFlags( $flags, $domain ) {
|
||||
protected function sanitizeConnectionFlags( $flags, $domain ) {
|
||||
if ( self::fieldHasBit( $flags, self::CONN_TRX_AUTOCOMMIT ) ) {
|
||||
// Callers use CONN_TRX_AUTOCOMMIT to bypass REPEATABLE-READ staleness without
|
||||
// resorting to row locks (e.g. FOR UPDATE) or to make small out-of-band commits
|
||||
|
|
|
|||
|
|
@ -79,6 +79,15 @@ class LoadBalancerSingle extends LoadBalancer {
|
|||
) );
|
||||
}
|
||||
|
||||
protected function sanitizeConnectionFlags( $flags, $domain ) {
|
||||
// There is only one underlying connection handle. Also, this class is only meant to
|
||||
// be used during situations like site installation, where there should be no contenting
|
||||
// connections, and integration testing, where everything uses temporary tables.
|
||||
$flags &= ~self::CONN_TRX_AUTOCOMMIT;
|
||||
|
||||
return $flags;
|
||||
}
|
||||
|
||||
protected function reallyOpenConnection( $i, DatabaseDomain $domain, array $lbInfo ) {
|
||||
foreach ( $lbInfo as $k => $v ) {
|
||||
$this->conn->setLBInfo( $k, $v );
|
||||
|
|
|
|||
Loading…
Reference in a new issue