]> git.mjollnir.org Git - moodle.git/commitdiff
Fixed insert/update of Oracle xLOBs. Credit goes to Rita Scholes. MDL-9835
authorstronk7 <stronk7>
Thu, 9 Aug 2007 18:17:48 +0000 (18:17 +0000)
committerstronk7 <stronk7>
Thu, 9 Aug 2007 18:17:48 +0000 (18:17 +0000)
Merged from MOODLE_18_STABLE

lib/dmllib.php

index 0da3d0716d3b8082116e47c9ed856095dcc3973a..56a2120059e0a4cfbf345ee6e640c039716136c5 100644 (file)
@@ -2303,6 +2303,11 @@ function db_update_lobs ($table, $sqlcondition, &$clobs, &$blobs) {
 
             if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; }; /// Count the extra updates in PERF
 
+        /// Oracle CLOBs doesn't like quoted strings (are inserted via prepared statemets)
+            if ($CFG->dbfamily == 'oracle') {
+                $value = stripslashes_safe($value);
+            }
+
             if (!$db->UpdateClob($CFG->prefix.$table, $key, $value, $sqlcondition)) {
                 $status = false;
                 $statement = "UpdateClob('$CFG->prefix$table', '$key', '" . substr($value, 0, 100) . "...', '$sqlcondition')";
@@ -2320,6 +2325,11 @@ function db_update_lobs ($table, $sqlcondition, &$clobs, &$blobs) {
 
             if (defined('MDL_PERFDB')) { global $PERF ; $PERF->dbqueries++; }; /// Count the extra updates in PERF
 
+        /// Oracle BLOBs doesn't like quoted strings (are inserted via prepared statemets)
+            if ($CFG->dbfamily == 'oracle') {
+                $value = stripslashes_safe($value);
+            }
+
             if(!$db->UpdateBlob($CFG->prefix.$table, $key, $value, $sqlcondition)) {
                 $status = false;
                 $statement = "UpdateBlob('$CFG->prefix$table', '$key', '" . substr($value, 0, 100) . "...', '$sqlcondition')";