mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Fixed insert/update of Oracle xLOBs. Credit goes to Rita Scholes. MDL-9835
Merged from MOODLE_18_STABLE
This commit is contained in:
parent
365a18e4b8
commit
88cd967851
1 changed files with 10 additions and 0 deletions
|
@ -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')";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue