Index: trunk/phase3/includes/Pager.php |
— | — | @@ -194,8 +194,11 @@ |
195 | 195 | function extractResultInfo( $offset, $limit, ResultWrapper $res ) { |
196 | 196 | $numRows = $res->numRows(); |
197 | 197 | if ( $numRows ) { |
| 198 | + # Remove any table prefix from index field |
| 199 | + $indexColumn = end( explode( '.', $this->mIndexField ) ); |
| 200 | + |
198 | 201 | $row = $res->fetchRow(); |
199 | | - $firstIndex = $row[$this->mIndexField]; |
| 202 | + $firstIndex = $row[$indexColumn]; |
200 | 203 | |
201 | 204 | # Discard the extra result row if there is one |
202 | 205 | if ( $numRows > $this->mLimit && $numRows > 1 ) { |
— | — | @@ -205,7 +208,7 @@ |
206 | 209 | $this->mPastTheEndIndex = $this->mPastTheEndRow->$indexField; |
207 | 210 | $res->seek( $numRows - 2 ); |
208 | 211 | $row = $res->fetchRow(); |
209 | | - $lastIndex = $row[$this->mIndexField]; |
| 212 | + $lastIndex = $row[$indexColumn]; |
210 | 213 | } else { |
211 | 214 | $this->mPastTheEndRow = null; |
212 | 215 | # Setting indexes to an empty string means that they will be |
— | — | @@ -215,7 +218,7 @@ |
216 | 219 | $this->mPastTheEndIndex = ''; |
217 | 220 | $res->seek( $numRows - 1 ); |
218 | 221 | $row = $res->fetchRow(); |
219 | | - $lastIndex = $row[$this->mIndexField]; |
| 222 | + $lastIndex = $row[$indexColumn]; |
220 | 223 | } |
221 | 224 | } else { |
222 | 225 | $firstIndex = ''; |