MDL-37718 release low level recordsets as soon as possible

This commit is contained in:
Petr Škoda
2013-01-26 17:20:43 +01:00
parent b3778a0dec
commit 9e6bfb5221
5 changed files with 47 additions and 12 deletions
+8 -1
View File
@@ -62,7 +62,14 @@ class pgsql_native_moodle_recordset extends moodle_recordset {
}
private function fetch_next() {
$row = pg_fetch_assoc($this->result);
if (!$this->result) {
return false;
}
if (!$row = pg_fetch_assoc($this->result)) {
pg_free_result($this->result);
$this->result = null;
return false;
}
if ($this->blobs) {
foreach ($this->blobs as $blob) {