]> git.mjollnir.org Git - moodle.git/commitdiff
Add update_record() postgres bytea support
authorpatrickslee <patrickslee>
Fri, 10 Mar 2006 03:32:48 +0000 (03:32 +0000)
committerpatrickslee <patrickslee>
Fri, 10 Mar 2006 03:32:48 +0000 (03:32 +0000)
To get ready for the postgres utf8 migration script

lib/datalib.php

index c85b6ce191ca9d841ee81349349b4d00e3a22ee6..d6b24bbb91f4e073d79cbaa34d28b1de4fd8ac6f 100644 (file)
@@ -1241,6 +1241,10 @@ function update_record($table, $dataobject) {
     foreach ($columns as $column) {
         if ($column->name <> 'id' and isset($data[$column->name]) ) {
             $ddd[$column->name] = $data[$column->name];
+            // PostgreSQL bytea support
+            if ($CFG->dbtype == 'postgres7' && $column->type == 'bytea') {
+                $ddd[$column->name] = $db->BlobEncode($ddd[$column->name]);
+            }
         }
     }