Index: trunk/phase3/maintenance/FiveUpgrade.inc |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | $timeout = 3600 * 24; |
102 | 102 | $db =& $this->newConnection(); |
103 | 103 | $db->bufferResults( false ); |
104 | | - if ($wgDBtype == 'mysql') { |
| 104 | + if ($wgDBtype == 'mysql') { |
105 | 105 | $db->query( "SET net_read_timeout=$timeout" ); |
106 | 106 | $db->query( "SET net_write_timeout=$timeout" ); |
107 | 107 | } |
Index: trunk/phase3/maintenance/updateArticleCount.inc.php |
— | — | @@ -38,7 +38,8 @@ |
39 | 39 | function makeSql() { |
40 | 40 | list( $page, $pagelinks ) = $this->dbr->tableNamesN( 'page', 'pagelinks' ); |
41 | 41 | $nsset = $this->makeNsSet(); |
42 | | - return "SELECT DISTINCT page_namespace,page_title FROM $page,$pagelinks " . |
| 42 | + return "SELECT COUNT(DISTINCT page_namespace, page_title) AS pagecount " . |
| 43 | + "FROM $page, $pagelinks " . |
43 | 44 | "WHERE pl_from=page_id and page_namespace IN ( $nsset ) " . |
44 | 45 | "AND page_is_redirect = 0 AND page_len > 0"; |
45 | 46 | } |
— | — | @@ -50,15 +51,9 @@ |
51 | 52 | */ |
52 | 53 | function count() { |
53 | 54 | $res = $this->dbr->query( $this->makeSql(), __METHOD__ ); |
54 | | - if( $res ) { |
55 | | - $count = $this->dbr->numRows( $res ); |
56 | | - $this->dbr->freeResult( $res ); |
57 | | - return $count; |
58 | | - } else { |
59 | | - # Look out for this when handling the result |
60 | | - # - Actually it's unreachable, !$res throws an exception -- TS |
61 | | - return false; |
62 | | - } |
| 55 | + $row = $this->dbr->fetchObject( $res ); |
| 56 | + $this->dbr->freeResult( $res ); |
| 57 | + return $row->pagecount; |
63 | 58 | } |
64 | 59 | |
65 | 60 | } |