If the same call to User::idFromName('Test') is called twice at the 1,000 entry limit on User::$idCacheByName it will result in two database queries being ran instead of one. This is because it adds the just looked up database query to the cache then does the check to truncate the cache.
Description
Description
Details
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
user: Move idFromName cache truncation to before adding the new value | mediawiki/core | master | +3 -3 |
Event Timeline
Comment Actions
Change 517108 had a related patch set uploaded (by Alexia; owner: Alexia):
[mediawiki/core@master] Truncate the idFromName cache before added the new look up to prevent a double query for the same User::idFromName() call.
Comment Actions
Change 517108 merged by jenkins-bot:
[mediawiki/core@master] user: Move idFromName cache truncation to before adding the new value