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

lib/statslib SQL errors under Oracle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9.2
    • 1.9
    • Administration
    • None
    • Oracle
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      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 ''; }

      }

        1. MDL-13861.patch.txt
          27 kB
          Eloy Lafuente (stronk7)
        2. usq-stats-from-dual.patch
          6 kB
          Jonathon Fowler

            stronk7 Eloy Lafuente (stronk7)
            jonof Jonathon Fowler
            Tim Hunt Tim Hunt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.