From: Brad Jorsch Date: Mon, 8 May 2017 17:57:13 +0000 (-0400) Subject: Prettify MessageCache::loadFromDB()-small query X-Git-Tag: 1.31.0-rc.0~3296^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=f0a80ea778057379a16e277348ab5e11d939b137;p=lhc%2Fweb%2Fwiklou.git Prettify MessageCache::loadFromDB()-small query Adjust the call so it uses JOIN...ON syntax rather than comma joins. Bug: T164666 Change-Id: I93c8569620d543e9507d0adf1283443915f50d4b --- diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php index 5caa7d5f35..c992112068 100644 --- a/includes/cache/MessageCache.php +++ b/includes/cache/MessageCache.php @@ -515,15 +515,18 @@ class MessageCache { # Conditions to load the remaining pages with their contents $smallConds = $conds; - $smallConds[] = 'page_latest=rev_id'; - $smallConds[] = 'rev_text_id=old_id'; $smallConds[] = 'page_len <= ' . intval( $wgMaxMsgCacheEntrySize ); $res = $dbr->select( [ 'page', 'revision', 'text' ], [ 'page_title', 'old_id', 'old_text', 'old_flags' ], $smallConds, - __METHOD__ . "($code)-small" + __METHOD__ . "($code)-small", + [], + [ + 'revision' => [ 'JOIN', 'page_latest=rev_id' ], + 'text' => [ 'JOIN', 'rev_text_id=old_id' ], + ] ); foreach ( $res as $row ) {