MDL-37165 Assignment: Oracle fix for count_submissions_with_status (and friends).
authorDamyon Wiese <damyon@moodle.com>
Fri, 14 Dec 2012 07:15:08 +0000 (15:15 +0800)
committerDamyon Wiese <damyon@moodle.com>
Fri, 14 Dec 2012 07:16:06 +0000 (15:16 +0800)
Oracle does not like the use of AS after a join.

mod/assign/locallib.php

index e0bfc1d..2564d0e 100644 (file)
@@ -1074,7 +1074,7 @@ class assign {
                    LEFT JOIN {assign_grades} g ON
                         s.assignment = g.assignment AND
                         s.userid = g.userid
                    LEFT JOIN {assign_grades} g ON
                         s.assignment = g.assignment AND
                         s.userid = g.userid
-                   JOIN(' . $esql . ') AS e ON e.id = s.userid
+                   JOIN(' . $esql . ') e ON e.id = s.userid
                    WHERE
                         s.assignment = :assignid AND
                         s.timemodified IS NOT NULL AND
                    WHERE
                         s.assignment = :assignid AND
                         s.timemodified IS NOT NULL AND
@@ -1104,7 +1104,7 @@ class assign {
                    LEFT JOIN {assign_grades} g ON
                         s.assignment = g.assignment AND
                         s.userid = g.userid
                    LEFT JOIN {assign_grades} g ON
                         s.assignment = g.assignment AND
                         s.userid = g.userid
-                   JOIN(' . $esql . ') AS e ON e.id = s.userid
+                   JOIN(' . $esql . ') e ON e.id = s.userid
                    WHERE
                         s.assignment = :assignid AND
                         s.timemodified IS NOT NULL AND
                    WHERE
                         s.assignment = :assignid AND
                         s.timemodified IS NOT NULL AND
@@ -1173,7 +1173,7 @@ class assign {
         $sql = 'SELECT s.*, u.lastname, u.firstname, u.username
                    FROM {assign_submission} s
                    JOIN {user} u ON s.userid = u.id
         $sql = 'SELECT s.*, u.lastname, u.firstname, u.username
                    FROM {assign_submission} s
                    JOIN {user} u ON s.userid = u.id
-                   JOIN(' . $esql . ') AS e ON e.id = s.userid
+                   JOIN(' . $esql . ') e ON e.id = s.userid
                    WHERE
                         s.assignment = :assignid AND
                         s.timemodified IS NOT NULL';
                    WHERE
                         s.assignment = :assignid AND
                         s.timemodified IS NOT NULL';