[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make WikiPage::getRevision() make use of Revision::newKnownC...
Aaron Schulz has uploaded a new change for review. https://gerrit.wikimedia.org/r/310705 Change subject: Make WikiPage::getRevision() make use of Revision::newKnownCurrent() .. Make WikiPage::getRevision() make use of Revision::newKnownCurrent() Change-Id: Id06319b31bc523a5d514930c3d609af4d991453b --- M includes/page/WikiPage.php 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/05/310705/1 diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index c09d0eb..6c0c4a8 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -621,15 +621,18 @@ // happened after the first S1 SELECT. // http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html#isolevel_repeatable-read $flags = Revision::READ_LOCKING; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); } elseif ( $this->mDataLoadedFrom == self::READ_LATEST ) { // Bug T93976: if page_latest was loaded from the master, fetch the // revision from there as well, as it may not exist yet on a replica DB. // Also, this keeps the queries in the same REPEATABLE-READ snapshot. $flags = Revision::READ_LATEST; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); } else { - $flags = 0; + $dbr = wfGetDB( DB_REPLICA ); + $revision = Revision::newKnownCurrent( $dbr, $this->getId(), $latest ); } - $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); + if ( $revision ) { // sanity $this->setLastEdit( $revision ); } -- To view, visit https://gerrit.wikimedia.org/r/310705 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id06319b31bc523a5d514930c3d609af4d991453b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Make WikiPage::getRevision() make use of Revision::newKnownC...
jenkins-bot has submitted this change and it was merged. Change subject: Make WikiPage::getRevision() make use of Revision::newKnownCurrent() .. Make WikiPage::getRevision() make use of Revision::newKnownCurrent() Change-Id: Id06319b31bc523a5d514930c3d609af4d991453b --- M includes/page/WikiPage.php 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Krinkle: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index c09d0eb..6c0c4a8 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -621,15 +621,18 @@ // happened after the first S1 SELECT. // http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html#isolevel_repeatable-read $flags = Revision::READ_LOCKING; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); } elseif ( $this->mDataLoadedFrom == self::READ_LATEST ) { // Bug T93976: if page_latest was loaded from the master, fetch the // revision from there as well, as it may not exist yet on a replica DB. // Also, this keeps the queries in the same REPEATABLE-READ snapshot. $flags = Revision::READ_LATEST; + $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); } else { - $flags = 0; + $dbr = wfGetDB( DB_REPLICA ); + $revision = Revision::newKnownCurrent( $dbr, $this->getId(), $latest ); } - $revision = Revision::newFromPageId( $this->getId(), $latest, $flags ); + if ( $revision ) { // sanity $this->setLastEdit( $revision ); } -- To view, visit https://gerrit.wikimedia.org/r/310705 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id06319b31bc523a5d514930c3d609af4d991453b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Aaron Schulz Gerrit-Reviewer: Krinkle Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits