Merge "Prettify MessageCache::loadFromDB()-small query"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 9 May 2017 02:32:34 +0000 (02:32 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 9 May 2017 02:32:34 +0000 (02:32 +0000)
includes/cache/MessageCache.php

index 5caa7d5..c992112 100644 (file)
@@ -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 ) {