Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -1423,7 +1423,7 @@ |
1424 | 1424 | |
1425 | 1425 | # If we know that this is now the new stable version |
1426 | 1426 | # (which it probably is), save it to the cache... |
1427 | | - $sv = FlaggedRevision::newFromStable( $article->getTitle(), FR_FOR_UPDATE ); |
| 1427 | + $sv = FlaggedRevision::newFromStable( $article->getTitle(), FR_FOR_UPDATE/*consistent*/ ); |
1428 | 1428 | if( $sv && $sv->getRevId() == $rev->getId() ) { |
1429 | 1429 | # Update stable cache |
1430 | 1430 | self::updatePageCache( $article, $poutput ); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php |
— | — | @@ -69,8 +69,7 @@ |
70 | 70 | # User master/slave as appropriate |
71 | 71 | if( $flags & FR_FOR_UPDATE || $flags & FR_MASTER ) { |
72 | 72 | $db = wfGetDB( DB_MASTER ); |
73 | | - if( $flags & FR_FOR_UPDATE ) |
74 | | - $options[] = 'FOR UPDATE'; |
| 73 | + if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE'; |
75 | 74 | } else { |
76 | 75 | $db = wfGetDB( DB_SLAVE ); |
77 | 76 | } |
— | — | @@ -86,7 +85,8 @@ |
87 | 86 | 'fr_rev_id' => $revId, |
88 | 87 | 'rev_id = fr_rev_id', |
89 | 88 | 'rev_page = fr_page_id', |
90 | | - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), |
| 89 | + 'rev_deleted & '.Revision::DELETED_TEXT => 0 |
| 90 | + ), |
91 | 91 | __METHOD__, |
92 | 92 | $options |
93 | 93 | ); |
— | — | @@ -125,7 +125,8 @@ |
126 | 126 | $columns, |
127 | 127 | array( 'fp_page_id' => $pageId, |
128 | 128 | 'fr_page_id = fp_page_id', |
129 | | - 'fr_rev_id = fp_stable' ), |
| 129 | + 'fr_rev_id = fp_stable' |
| 130 | + ), |
130 | 131 | __METHOD__ |
131 | 132 | ); |
132 | 133 | if( !$row ) return null; |
— | — | @@ -139,7 +140,7 @@ |
140 | 141 | } |
141 | 142 | $dbw = wfGetDB( DB_MASTER ); |
142 | 143 | $options['ORDER BY'] = 'fr_rev_id DESC'; |
143 | | - if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE'; |
| 144 | + if( $flags & FR_FOR_UPDATE ) $options[] = 'LOCK IN SHARE MODE'; |
144 | 145 | # Look for the latest pristine revision... |
145 | 146 | if( FlaggedRevs::pristineVersions() && $config['select'] != FLAGGED_VIS_LATEST ) { |
146 | 147 | $prow = $dbw->selectRow( array('flaggedrevs','revision'), |
— | — | @@ -148,7 +149,8 @@ |
149 | 150 | 'fr_quality = 2', |
150 | 151 | 'rev_id = fr_rev_id', |
151 | 152 | 'rev_page = fr_page_id', |
152 | | - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), |
| 153 | + 'rev_deleted & '.Revision::DELETED_TEXT => 0 |
| 154 | + ), |
153 | 155 | __METHOD__, |
154 | 156 | $options |
155 | 157 | ); |
— | — | @@ -168,7 +170,8 @@ |
169 | 171 | $newerClause, |
170 | 172 | 'rev_id = fr_rev_id', |
171 | 173 | 'rev_page = fr_page_id', |
172 | | - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), |
| 174 | + 'rev_deleted & '.Revision::DELETED_TEXT => 0 |
| 175 | + ), |
173 | 176 | __METHOD__, |
174 | 177 | $options |
175 | 178 | ); |
— | — | @@ -181,7 +184,8 @@ |
182 | 185 | array( 'fr_page_id' => $pageId, |
183 | 186 | 'rev_id = fr_rev_id', |
184 | 187 | 'rev_page = fr_page_id', |
185 | | - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ), |
| 188 | + 'rev_deleted & '.Revision::DELETED_TEXT => 0 |
| 189 | + ), |
186 | 190 | __METHOD__, |
187 | 191 | $options |
188 | 192 | ); |
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php |
— | — | @@ -643,7 +643,7 @@ |
644 | 644 | $u = new LinksUpdate( $this->page, $poutput ); |
645 | 645 | # If we know that this is now the new stable version |
646 | 646 | # (which it probably is), save it to the stable cache... |
647 | | - $sv = FlaggedRevision::newFromStable( $this->page, FR_FOR_UPDATE ); |
| 647 | + $sv = FlaggedRevision::newFromStable( $this->page, FR_FOR_UPDATE/*consistent*/ ); |
648 | 648 | if( $sv && $sv->getRevId() == $rev->getId() ) { |
649 | 649 | global $wgParserCacheExpireTime; |
650 | 650 | $this->page->invalidateCache(); |