Merge #16633 - Fix #16614 - Correct the dataseek offset on MySQLI extension

Pull-request: #16633
Fixes: #16614

Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2021-02-17 01:53:55 +01:00
commit f29a762113
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -4336,7 +4336,10 @@ class Results
);
// fetch last row of the result set
$dbi->dataSeek($dt_result, $this->properties['num_rows'] - 1);
$dbi->dataSeek(
$dt_result,
$this->properties['num_rows'] > 0 ? $this->properties['num_rows'] - 1 : 0
);
$row = $dbi->fetchRow($dt_result);
// check for non printable sorted row data
@ -4566,7 +4569,10 @@ class Results
}
// fetch last row of the result set
$dbi->dataSeek($dt_result, $this->properties['num_rows'] - 1);
$dbi->dataSeek(
$dt_result,
$this->properties['num_rows'] > 0 ? $this->properties['num_rows'] - 1 : 0
);
$row = $dbi->fetchRow($dt_result);
// @see DbiMysqi::fetchRow & DatabaseInterface::fetchRow