jenkins-bot has submitted this change and it was merged.

Change subject: Fixed bitfield check in User::loadFromId()
......................................................................


Fixed bitfield check in User::loadFromId()

* 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
---
M includes/User.php
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/User.php b/includes/User.php
index 63c0d37..26d54ab 100644
--- a/includes/User.php
+++ b/includes/User.php
@@ -387,7 +387,8 @@
 
                // 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() ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/224203
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ief04ac20c7639fcf79443a3ee39a471542a59551
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to