Make the watchlist query ordering consistent across DBs.
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Tue, 5 Oct 2010 13:36:05 +0000 (13:36 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Tue, 5 Oct 2010 13:36:05 +0000 (13:36 +0000)
includes/WatchlistEditor.php

index 0e5a59e..8b089d0 100644 (file)
@@ -212,6 +212,9 @@ class WatchlistEditor {
                $sql = "SELECT wl_namespace, wl_title, page_id, page_len, page_is_redirect, page_latest
                        FROM {$watchlist} LEFT JOIN {$page} ON ( wl_namespace = page_namespace
                        AND wl_title = page_title ) WHERE wl_user = {$uid}";
+               if ( ! $dbr->implicitOrderby() ) {
+                       $sql .= " ORDER BY wl_title";
+               }
                $res = $dbr->query( $sql, __METHOD__ );
                if( $res && $dbr->numRows( $res ) > 0 ) {
                        $cache = LinkCache::singleton();