Index: trunk/extensions/IndexFunction/SpecialIndex.php |
— | — | @@ -133,13 +133,20 @@ |
134 | 134 | array( 'page' => array('JOIN','page_id=in_from') ) |
135 | 135 | ); |
136 | 136 | |
137 | | - $union = $this->mDb->unionQueries( array( $pagequery, $indexquery ), false ); |
| 137 | + $union = $this->unionQueries( array( $pagequery, $indexquery ), false ); |
138 | 138 | $union .= $order . $limit; |
139 | 139 | |
140 | 140 | $res = $this->mDb->query( $union, __METHOD__ ); |
141 | 141 | return new ResultWrapper( $this->mDb, $res ); |
142 | 142 | } |
| 143 | + |
| 144 | + // Copied from Database.php on MW trunk |
| 145 | + function unionQueries($sqls, $all) { |
| 146 | + $glue = $all ? ') UNION ALL (' : ') UNION ('; |
| 147 | + return '('.implode( $glue, $sqls ) . ')'; |
| 148 | + } |
143 | 149 | |
| 150 | + |
144 | 151 | } |
145 | 152 | |
146 | 153 | class SpecialIndex extends SpecialPage { |