Skip to content

Commit

Permalink
Fixed insert/update of Oracle xLOBs. Credit goes to Rita Scholes. MDL…
Browse files Browse the repository at this point in the history
…-9835
  • Loading branch information
stronk7 committed Aug 9, 2007
1 parent eee45d7 commit dda4bbb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/dmllib.php
Expand Up @@ -2178,6 +2178,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')";
Expand All @@ -2195,6 +2200,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')";
Expand Down

0 comments on commit dda4bbb

Please sign in to comment.