Fixed insert/update of Oracle xLOBs. Credit goes to Rita Scholes. MDL-9835

This commit is contained in:
stronk7
2007-08-09 18:16:47 +00:00
parent eee45d7fe6
commit dda4bbbf25
+10
View File
@@ -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')";
@@ -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')";