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

Oracle problem in a GROUP BY clause

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.9.3
    • 1.9.4
    • Quiz
    • None
    • Oracle
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      One of our clients reported that the following query doesn't work on Oracle:

      SELECT
      FLOOR(qg.grade/$bandwidth) AS band,
      COUNT(1) AS num
      FROM
      {$CFG->prefix}quiz_grades qg,
      {$CFG->prefix}quiz q
      WHERE qg.quiz = q.id AND qg.quiz = $quizid
      ".($useridlist?"AND qg.userid IN ($useridlist) ":'')."
      GROUP BY band
      ORDER BY band

      From: mod/quiz/report/reportlib.php, quiz_report_grade_bands()

      Repeating the FLOOR function in the GROUP BY clause seems to fix it though (see attached patch against 1.9).

      Attachments

        Activity

          People

            timhunt Tim Hunt
            francois Francois Marier
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Tim Hunt, Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              28/Jan/09