* READ_LOCKING is a composite field, so it can yeild 00, 01,
10, or 11 for the relevant two bits. Only one of them should
pass the check to avoid locking and snapshot breaking queries
for no reason.
Change-Id: Ief04ac20c7639fcf79443a3ee39a471542a59551
// Try cache (unless this needs to lock the DB).
// NOTE: if this thread called saveSettings(), the cache was cleared.
- if ( ( $flags & self::READ_LOCKING ) || !$this->loadFromCache() ) {
+ $locking = ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING );
+ if ( $locking || !$this->loadFromCache() ) {
wfDebug( "User: cache miss for user {$this->mId}\n" );
// Load from DB (make sure this thread sees its own changes)
if ( wfGetLB()->hasOrMadeRecentMasterChanges() ) {