Make MessageCache use the immutable text cache during cache rebuilds
[lhc/web/wiklou.git] / includes / cache / MessageCache.php
index 9bf0840..7cd489a 100644 (file)
@@ -508,7 +508,7 @@ class MessageCache {
 
                $res = $dbr->select(
                        [ 'page', 'revision', 'text' ],
-                       [ 'page_title', 'old_text', 'old_flags' ],
+                       [ 'page_title', 'old_id', 'old_text', 'old_flags' ],
                        $smallConds,
                        __METHOD__ . "($code)-small"
                );
@@ -584,7 +584,8 @@ class MessageCache {
                                        return;
                                }
                                // Load the messages from the master DB to avoid race conditions
-                               $this->loadFromDB( $code, self::FOR_UPDATE );
+                               $cache = $this->loadFromDB( $code, self::FOR_UPDATE );
+                               $this->mCache[$code] = $cache;
                                // Load the process cache values and set the per-title cache keys
                                $page = WikiPage::factory( Title::makeTitle( NS_MEDIAWIKI, $title ) );
                                $page->loadPageData( $page::READ_LATEST );