function extractResultInfo( $offset, $limit, ResultWrapper $res ) {
$numRows = $res->numRows();
if ( $numRows ) {
+ # Remove any table prefix from index field
+ $indexColumn = end( explode( '.', $this->mIndexField ) );
+
$row = $res->fetchRow();
- $firstIndex = $row[$this->mIndexField];
+ $firstIndex = $row[$indexColumn];
# Discard the extra result row if there is one
if ( $numRows > $this->mLimit && $numRows > 1 ) {
$this->mPastTheEndIndex = $this->mPastTheEndRow->$indexField;
$res->seek( $numRows - 2 );
$row = $res->fetchRow();
- $lastIndex = $row[$this->mIndexField];
+ $lastIndex = $row[$indexColumn];
} else {
$this->mPastTheEndRow = null;
# Setting indexes to an empty string means that they will be
$this->mPastTheEndIndex = '';
$res->seek( $numRows - 1 );
$row = $res->fetchRow();
- $lastIndex = $row[$this->mIndexField];
+ $lastIndex = $row[$indexColumn];
}
} else {
$firstIndex = '';