From: Reedy Date: Thu, 23 May 2019 23:16:42 +0000 (+0100) Subject: resourceloader: Use AND instead of OR for upsert conds in saveFileDependencies() X-Git-Tag: 1.31.2~14 X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=e765067d8a5f96f72dbca96f14ff728a75806966 resourceloader: Use AND instead of OR for upsert conds in saveFileDependencies() Follows-up e7b57d881a, which changed it from replace() to upsert() but lost one of the wrapping arrays in doing so. Previously updated many more rows than expected on Postgresql, when it should only be updating individual rows, not all rows that match either criteria. SQL query before: WHERE ((md_module = 'jquery.makeCollapsible.styles') OR (md_skin = 'vector|en-gb')) SQL query after: WHERE ((md_module = 'jquery.makeCollapsible.styles' AND md_skin = 'vector|en-gb')) Not a problem on MySQL as upsert() is implemented differently there. Bug: T222385 Change-Id: If8a458bf4543b297b3a06f31e09c0e77666bf7e6 --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index 622987f946..94bc4541ec 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -67,6 +67,8 @@ THIS IS NOT A RELEASE YET * (T219728) Added support for new Japanese era name "Reiwa" * (T25227) action=logout now requires to be posted and have a csrf token. * Updated cssjanus/cssjanus from 1.2.0 to 1.3.0. +* (T222385) resourceloader: Use AND instead of OR for upsert conds in + saveFileDependencies(). == MediaWiki 1.31.1 == diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index 6d1529b11a..2abc17c205 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -485,7 +485,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface { 'md_skin' => $vary, 'md_deps' => $deps, ], - [ 'md_module', 'md_skin' ], + [ [ 'md_module', 'md_skin' ] ], [ 'md_deps' => $deps, ]