Index: trunk/extensions/RandomImage/RandomImage.php |
— | — | @@ -83,7 +83,7 @@ |
84 | 84 | $rand = wfRandom(); |
85 | 85 | $index = $dbr->useIndexClause( 'page_random' ); |
86 | 86 | $sql = "SELECT page_title FROM {$page} {$index} WHERE page_namespace = {$nspc} |
87 | | - AND page_is_redirect = 0 AND page_random > {$rand}"; |
| 87 | + AND page_is_redirect = 0 AND page_random > {$rand} ORDER BY page_random LIMIT 1"; |
88 | 88 | $res = $dbr->query( $sql, 'RandomImage::pickImage' ); |
89 | 89 | if( $row = $dbr->fetchObject( $res ) ) { |
90 | 90 | $ret = Title::makeTitleSafe( $nspc, $row->page_title ); |