Skip to content
Permalink
Browse files

Fix storing onf NULLs by set_field_xxx() into binary columns.

  • Loading branch information...
stronk7
stronk7 committed Oct 15, 2009
1 parent c86bdd5 commit 489ef94fa8725413ab868b66a399379bcc1afdf1
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/dml/pgsql_native_moodle_database.php
@@ -981,7 +981,7 @@ public function set_field_select($table, $newfield, $newvalue, $select, array $p
$columns = $this->get_columns($table);
$column = $columns[$newfield];
if ($column->meta_type == 'B') { /// If the column is a BLOB
if ($column->meta_type == 'B' && $newvalue !== null) { /// If the column is a BLOB and the value is not null
/// Update BYTEA and return
$newvalue = pg_escape_bytea($this->pgsql, $newvalue);
$sql = "UPDATE {$this->prefix}$table SET $newfield = '$newvalue'::bytea $select";

0 comments on commit 489ef94

Please sign in to comment.
You can’t perform that action at this time.