Skip to content

Commit

Permalink
MDL-37165 Assignment: Oracle fix for count_submissions_with_status (a…
Browse files Browse the repository at this point in the history
…nd friends).

Oracle does not like the use of AS after a join.
  • Loading branch information
Damyon Wiese committed Dec 14, 2012
1 parent 04e56da commit 0c7b691
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mod/assign/locallib.php
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0c7b691

Please sign in to comment.