r51858 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51857‎ | r51858 | r51859 >
Date:03:05, 15 June 2009
Author:mrzman
Status:ok (Comments)
Tags:
Comment:
(bug 19160) Use DISTINCT instead of DISTINCTROW for compatibility with postgresql
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/purgeOldText.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/purgeOldText.inc
@@ -20,7 +20,7 @@
2121
2222 # Get "active" text records from the revisions table
2323 echo( "Searching for active text records in revisions table..." );
24 - $res = $dbw->query( "SELECT DISTINCTROW rev_text_id FROM $tbl_rev" );
 24+ $res = $dbw->query( "SELECT DISTINCT rev_text_id FROM $tbl_rev" );
2525 while( $row = $dbw->fetchObject( $res ) ) {
2626 $cur[] = $row->rev_text_id;
2727 }
@@ -28,7 +28,7 @@
2929
3030 # Get "active" text records from the archive table
3131 echo( "Searching for active text records in archive table..." );
32 - $res = $dbw->query( "SELECT DISTINCTROW ar_text_id FROM $tbl_arc" );
 32+ $res = $dbw->query( "SELECT DISTINCT ar_text_id FROM $tbl_arc" );
3333 while( $row = $dbw->fetchObject( $res ) ) {
3434 $cur[] = $row->ar_text_id;
3535 }
Index: trunk/phase3/RELEASE-NOTES
@@ -184,6 +184,7 @@
185185 * (bug 19112) Preferences now respects $wgUseExternalEditor, $wgExternalDiffEngine
186186 * (bug 18173) MediaWiki now fails when unable to determine a client IP
187187 * (bug 19170) Special:Version should follow the content language direction
 188+* (bug 19160) maintenance/purgeOldText.inc is now compatible with PostgreSQL
188189
189190 == API changes in 1.16 ==
190191

Comments

#Comment by Simetrical (talk | contribs)   21:47, 15 June 2009

Why not make this $dbw->select( 'revision', 'rev_text_id', '', __METHOD__, 'DISTINCT' ); instead? You could get rid of the tableName() calls this way.

Status & tagging log