From: Aaron Schulz Date: Sat, 21 Jul 2012 18:21:15 +0000 (-0700) Subject: Fixed DATA_FOR_UPDATE loading in WikiPage. X-Git-Tag: 1.31.0-rc.0~22984^2 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=852cdfb1487f4e814bef8b3f2414dbcf36472bc1;p=lhc%2Fweb%2Fwiklou.git Fixed DATA_FOR_UPDATE loading in WikiPage. Change-Id: Ifc4259942eb8bf5e91e80ec0009c2a2ab191ae11 --- diff --git a/includes/WikiPage.php b/includes/WikiPage.php index 6d9170a776..2de1626b51 100644 --- a/includes/WikiPage.php +++ b/includes/WikiPage.php @@ -540,7 +540,14 @@ class WikiPage extends Page { return; // page doesn't exist or is missing page_latest info } - $revision = Revision::newFromPageId( $this->getId(), $latest ); + // Bug 37225: if session S1 loads the page row FOR UPDATE, the result always includes the + // latest changes committed. This is true even within REPEATABLE-READ transactions, where + // S1 normally only sees changes committed before the first S1 SELECT. Thus we need S1 to + // also gets the revision row FOR UPDATE; otherwise, it may not find it since a page row + // UPDATE and revision row INSERT by S2 may have happened after the first S1 SELECT. + // http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html#isolevel_repeatable-read. + $flags = ( $this->mDataLoadedFrom == self::DATA_FOR_UPDATE ) ? Revision::LOCKING_READ : 0; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); if ( $revision ) { // sanity $this->setLastEdit( $revision ); }