Index: trunk/phase3/includes/QueryPage.php |
— | — | @@ -295,7 +295,7 @@ |
296 | 296 | $res = $this->reallyDoQuery( $limit, false ); |
297 | 297 | $num = false; |
298 | 298 | if ( $res ) { |
299 | | - $num = $dbr->numRows( $res ); |
| 299 | + $num = $res->numRows(); |
300 | 300 | # Fetch results |
301 | 301 | $vals = array(); |
302 | 302 | while ( $res && $row = $dbr->fetchObject( $res ) ) { |
— | — | @@ -733,6 +733,10 @@ |
734 | 734 | * Cache page existence for performance |
735 | 735 | */ |
736 | 736 | function preprocessResults( $db, $res ) { |
| 737 | + if ( !$res->numRows() ) { |
| 738 | + return; |
| 739 | + } |
| 740 | + |
737 | 741 | $batch = new LinkBatch; |
738 | 742 | foreach ( $res as $row ) { |
739 | 743 | $batch->add( $row->namespace, $row->title ); |
— | — | @@ -740,9 +744,7 @@ |
741 | 745 | $batch->execute(); |
742 | 746 | |
743 | 747 | // Back to start for display |
744 | | - if ( $db->numRows( $res ) > 0 ) |
745 | | - // If there are no rows we get an error seeking. |
746 | | - $db->dataSeek( $res, 0 ); |
| 748 | + $res->seek( 0 ); |
747 | 749 | } |
748 | 750 | |
749 | 751 | /** |