Permalink
Browse files

MDL-37165 Assignment: Oracle fix for count_submissions_with_status (a…

…nd friends).

Oracle does not like the use of AS after a join.
  • Loading branch information...
1 parent 4c7e6ea commit 41575c5571185747e5227d6dbe6e682d711e5170 @damyon damyon committed with danpoltawski Dec 14, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 mod/assign/locallib.php
@@ -1154,7 +1154,7 @@ public function count_submissions_need_grading() {
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
@@ -1183,7 +1183,7 @@ public function count_grades() {
$sql = 'SELECT COUNT(g.userid)
FROM {assign_grades} g
- JOIN(' . $esql . ') AS e ON e.id = g.userid
+ JOIN(' . $esql . ') e ON e.id = g.userid
WHERE g.assignment = :assignid';
return $DB->count_records_sql($sql, $params);
@@ -1222,7 +1222,7 @@ public function count_submissions() {
$sql = 'SELECT COUNT(s.userid)
FROM {assign_submission} s
- 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';
@@ -1258,7 +1258,7 @@ public function count_submissions_with_status($status) {
} else {
$sql = 'SELECT COUNT(s.userid)
FROM {assign_submission} s
- 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

0 comments on commit 41575c5

Please sign in to comment.