diff --git a/lib/dml/moodle_database.php b/lib/dml/moodle_database.php index ce28102e1b8..80c44b41c6e 100644 --- a/lib/dml/moodle_database.php +++ b/lib/dml/moodle_database.php @@ -2288,7 +2288,7 @@ abstract class moodle_database { if (core_text::strlen($search) < core_text::strlen($replace)) { $colsize = $column->max_length; $sql = "UPDATE {".$table."} - SET $columnname = SUBSTRING(REPLACE($columnname, ?, ?), 1, $colsize) + SET $columnname = " . $this->sql_substr("REPLACE(" . $columnname . ", ?, ?)", 1, $colsize) . " WHERE $columnname IS NOT NULL"; } $this->execute($sql, array($search, $replace)); diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index fed5c85bb69..9645c9a783a 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -1731,6 +1731,16 @@ class oci_native_moodle_database extends moodle_database { } } + /** + * Does this driver support tool_replace? + * + * @since Moodle 2.8 + * @return bool + */ + public function replace_all_text_supported() { + return true; + } + public function session_lock_supported() { return true; }