r73348 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r73347‎ | r73348 | r73349 >
Date:23:25, 19 September 2010
Author:demon
Status:resolved (Comments)
Tags:
Comment:
Followup r70608, don't use master connection just for type check, and use getType() instead of instanceof
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/includes/Revision.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Revision.php
@@ -314,8 +314,8 @@
315315
316316 if( isset( $row->page_latest ) ) {
317317 $this->mCurrent = ( $row->rev_id == $row->page_latest );
318 - $this->mTitle = Title::makeTitle( $row->page_namespace, $row->page_title );
319 - $this->mTitle->resetArticleID( $this->mPage );
 318+ $row->page_id = $this->mPage;
 319+ $this->mTitle = Title::newFromRow( $row );
320320 } else {
321321 $this->mCurrent = false;
322322 $this->mTitle = null;
Index: trunk/phase3/includes/Block.php
@@ -861,8 +861,8 @@
862862 # BEGIN DatabaseMssql hack
863863 # Since MSSQL doesn't recognize the infinity keyword, set date manually.
864864 # TO-DO: Refactor for better DB portability and remove magic date
865 - $dbw = wfGetDB( DB_MASTER );
866 - if ( $dbw instanceof DatabaseMssql ) {
 865+ $dbr = wfGetDB( DB_SLAVE );
 866+ if ( $dbr->getType() == 'mssql' ) {
867867 return '3000-01-31 00:00:00.000';
868868 }
869869 # End DatabaseMssql hack

Follow-up revisions

RevisionCommit summaryAuthorDate
r73349Followup r73348, rv unrelated changedemon23:27, 19 September 2010
r79644Followup r73348, r70608: move 'infinity' stuff to DB classesdemon13:43, 5 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70608DatabaseMssql class and related changesyaauie23:44, 6 August 2010

Comments

#Comment by MaxSem (talk | contribs)   04:36, 20 September 2010

Ideally, this thingie should be moved to DatabaseBase.

Status & tagging log