-
Bug
-
Resolution: Fixed
-
Major
-
2.0.5, 2.1.2, 2.2
-
None
-
RHEL6, Oracle 11g
-
Oracle
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_20_STABLE, MOODLE_21_STABLE
-
Following the fix for MDL-29496, searching for courses fails under the Oracle database with this error: ORA-00932: inconsistent datatypes: expected CLOB got CHAR
The problem is the COALESCE(c.summary, ' ') in lib/datalib.php (around line 720) which mixes CLOB and CHAR. A solution is this:
- $concat = $DB->sql_concat("COALESCE(c.summary, '". $DB->sql_empty() ."')", "' '", 'c.fullname', "' '", 'c.idnumber', "' '", 'c.shortname');
|
+ $concat = $DB->sql_concat("COALESCE(". $DB->sql_compare_text("c.summary", 2000) .", '". $DB->sql_empty() ."')", "' '", 'c.fullname', "' '", 'c.idnumber', "' '", 'c.shortname');
|
The 2000 parameter is because by default $DB->sql_compare_text() takes only the first 32 characters of c.summary, which is not very many, but this only affects databases for which $DB->sql_compare_text() isn't a no-op.