Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.8
-
Fix Version/s: None
-
Labels:None
-
Environment:Solaris
-
Database:Oracle
-
Affected Branches:MOODLE_18_STABLE
Description
The backup of the quiz activities doesn't work due to two Oracle exceptions. We have detected and solved both problems:
- First of all, there is a query of a clob column which isn't working:
$categorieswithrandom = get_records_sql("
SELECT DISTINCT question.category AS id
FROM {$CFG->prefix}quiz_question_instances qqi,
$from
{$CFG->prefix}question question
WHERE question.id = qqi.question
AND question.qtype = '" . RANDOM . "'
AND to_char(question.questiontext) = '1'
$where
");
To solve this problem notice that we have added the to_char function to the clob column name.
- The second problem is an insert in the info clob column of an empty string (''). To solve this problem we have added and white space (' ') instead of empty (''):
$status = execute_sql("INSERT INTO {$CFG->prefix}backup_ids
(backup_code, table_name, old_id, info)
SELECT '$backup_unique_code', 'question_categories', qc.id, ' '
FROM {$CFG->prefix}question_categories qc
WHERE qc.course = $course", false);
In general, we have detected that all the clob columns are always problematic so it would be nice to revise the DB API to solve it at this level.
Thank you in advance!
Thanks for reporting this issue.
We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.
If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.
Michael d;
lqjjLKA0p6