I think that the function Database::buildComparison() (added by me in change 829293) is very cool and should be used instead of raw SQL in more places where we build queries comparing multiple values. This task is to group all the patches for this. (It could be used for simple comparisons too, but in those cases it's more arguable whether it would be an improvement, so I'm not planning mass replacements.)
I replaced some common patterns in MediaWiki core already in these changes, which can serve as examples:
- https://gerrit.wikimedia.org/r/c/mediawiki/core/ /829293
- https://gerrit.wikimedia.org/r/c/mediawiki/core/ /832625
Helpful code search: https://codesearch-beta.wmcloud.org/deployed/?q=^[^\*\/]+\bOR\b&files=\.php$&excludeFiles=&repos= (this just searches for "OR" in uppercase as a separate word, so there are many false positives in these results – the list below is manually filtered)
- MediaWiki core
- ✔ Use buildComparison() instead of raw SQL in API list=backlinks and friends
- ✔ Use buildComparison() instead of raw SQL in API prop=linkshere and friends
- ✔ Use buildComparison() instead of raw SQL in API list=categorymembers
- ✔ Use buildComparison() instead of raw SQL in API list=exturlusage, prop=extlinks
- ✔ Use buildComparison() instead of raw SQL in API list=random
- ✔ Use buildComparison() instead of raw SQL in API list=usercontribs
- ✔ Use buildComparison() instead of raw SQL in REST API
- ✔ Use buildComparison() instead of raw SQL in CategoryMembershipChangeJob
- ✔ Use buildComparison() instead of raw SQL in WatchedItemQueryService
- ✔ Use buildComparison() instead of raw SQL in RevisionStore
- ✔ Use buildComparison() instead of raw SQL in SpecialWhatLinksHere
- ✔ Use buildComparison() instead of raw SQL in more maintenance scripts
- mediawiki/extensions/CheckUser
- mediawiki/extensions/Echo
- mediawiki/extensions/FlaggedRevs
maintenance/clearCachedText.php (1 matches)
- mediawiki/extensions/GeoData
- mediawiki/extensions/GlobalUsage
- mediawiki/extensions/PageAssessments
- mediawiki/extensions/PageTriage
- mediawiki/extensions/Wikibase
- mediawiki/extensions/WikimediaMaintenance
fixT260485.php (1 matches)