MDL-39024 fix MSSQL seek past the end of recordset

This commit is contained in:
Petr Škoda
2013-04-09 01:59:43 +02:00
committed by Eloy Lafuente (stronk7)
parent 0816f853fa
commit 239fb7ac41
+5 -1
View File
@@ -713,7 +713,11 @@ class mssql_native_moodle_database extends moodle_database {
$this->query_end($result);
if ($limitfrom) { // Skip $limitfrom records
mssql_data_seek($result, $limitfrom);
if (!@mssql_data_seek($result, $limitfrom)) {
// Nothing, most probably seek past the end.
mssql_free_result($result);
$result = null;
}
}
return $this->create_recordset($result);