Moodle

accesslib: Broken SQL on Oracle (breaks cron)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.8.9
  • Fix Version/s: 1.8.10
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Database:
    Oracle
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE

Description

In 1.8 under Oracle, the cron stops with a Fatal error:

Starting activity modules
Processing module function assignment_cron ...done.
Processing module function forum_cron ...Starting digest processing...
Cleaned old digest records
done.
Processing module function journal_cron ...done.
Processing module function workshop_cron ...done.
Processing module function exercise_cron ...done.
Finished activity modules
Starting blocks
Processing cron function for search....Global searching is not enabled. Nothing performed by search.
done.
Finished blocks
Updating languages cache
Removing expired enrolments ...0 to delete
none found
Running backups if required...
Checking backup status...INACTIVE
Backup tasks finished.
Running auth crons if required...
<div class="notifytiny" style="text-align:center">ORA-00923: FROM keyword not found where expected<br /><br /> SELECT 40 AS level,
c.instanceid AS instanceid
FROM mdcontext c
LEFT OUTER JOIN mdcourse_categories AS t
ON c.instanceid = t.id
WHERE t.id IS NULL AND c.contextlevel = 40
UNION
SELECT 50 AS level,
c.instanceid AS instanceid
FROM mdcontext c
LEFT OUTER JOIN mdcourse AS t
ON c.instanceid = t.id
WHERE t.id IS NULL AND c.contextlevel = 50
UNION
SELECT 70 AS level,
c.instanceid AS instanceid
FROM mdcontext c
LEFT OUTER JOIN mdcourse_modules AS t
ON c.instanceid = t.id
WHERE t.id IS NULL AND c.contextlevel = 70
UNION
SELECT 30 AS level,
c.instanceid AS instanceid
FROM mdcontext c
LEFT OUTER JOIN mduser AS t
ON c.instanceid = t.id
WHERE t.id IS NULL AND c.contextlevel = 30
UNION
SELECT 80 AS level,
c.instanceid AS instanceid
FROM mdcontext c
LEFT OUTER JOIN mdblock_instance AS t
ON c.instanceid = t.id
WHERE t.id IS NULL AND c.contextlevel = 80
UNION
SELECT 60 AS level,
c.instanceid AS instanceid
FROM mdcontext c
LEFT OUTER JOIN mdgroups AS t
ON c.instanceid = t.id
WHERE t.id IS NULL AND c.contextlevel = 60
<ul style="text-align:left"><li>line 677 of lib/dmllib.php: call to debugging()</li><li>line 1871 of lib/accesslib.php: call to get_recordset_sql()</li><li>line 365 of admin/cron.php: call to cleanup_contexts()</li></ul></div><br />
<br />
<b>Fatal error</b>: Call to a member function RecordCount() on a non-object in <b>/moodle/lib/accesslib.php</b> on line <b>1872</b><br />

Activity

Hide
Francois Marier added a comment -

Here's a patch which fixes the broken SQL.

Show
Francois Marier added a comment - Here's a patch which fixes the broken SQL.
Hide
Francois Marier added a comment -

Oops, I had forgotten to rename one of the "level" in my last patch.

Updated with oracle_fix_accesslib2.patch (still against the latest 1.8).

Show
Francois Marier added a comment - Oops, I had forgotten to rename one of the "level" in my last patch. Updated with oracle_fix_accesslib2.patch (still against the latest 1.8).
Hide
Francois Marier added a comment -

Alright, most of the patch didn't apply to 1.8 actually. It looks like local customisations.

I have however fixed the one remaining issue (bottom of that patch).

Show
Francois Marier added a comment - Alright, most of the patch didn't apply to 1.8 actually. It looks like local customisations. I have however fixed the one remaining issue (bottom of that patch).

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: