Fix retrieving of NULLs in PG databases and binary fields

This commit is contained in:
stronk7
2009-10-14 10:32:48 +00:00
parent ccbef34880
commit 2b4cf032fa
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -653,7 +653,7 @@ class pgsql_native_moodle_database extends moodle_database {
$id = reset($row);
if ($blobs) {
foreach ($blobs as $blob) {
$row[$blob] = pg_unescape_bytea($row[$blob]);
$row[$blob] = $row[$blob] !== null ? pg_unescape_bytea($row[$blob]) : null;
}
}
if (isset($return[$id])) {
+1 -1
View File
@@ -62,7 +62,7 @@ class pgsql_native_moodle_recordset extends moodle_recordset {
if ($this->blobs) {
foreach ($this->blobs as $blob) {
$row[$blob] = pg_unescape_bytea($row[$blob]);
$row[$blob] = $row[$blob] !== null ? pg_unescape_bytea($row[$blob]) : null;
}
}