Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-13861

lib/statslib SQL errors under Oracle

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.2
    • Component/s: Administration
    • Labels:
      None
    • Database:
      Oracle
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Under Oracle, SQL statements like "SELECT fields1, fields2" with no "FROM table" are invalid and produce a "FROM keyword not found where expected" error. This is most obvious when the cron task performs its stats collection. The solution is to select from the dummy 'DUAL' table in statements affected.

      Attached is my workaround patch I'm using for the moment, which is probably only useful to locate the problematic statements until an official solution is implemented. Perhaps a function like the one below could be added to dmllib to get around this in a compatible manner?

      function sql_null_from() {
      global $CFG;
      switch ($CFG->dbfamily)

      { case 'oracle': return 'FROM DUAL'; default: return ''; }

      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stronk7 Eloy Lafuente (stronk7)
                Reporter:
                jonof Jonathon Fowler
                Tester:
                Tim Hunt
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jul/08