mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-49216 mod_forum: Move subquery to outer component
It is not possible to order sub-query results with some RDBMs, and the subquery is not necessary anyway.
This commit is contained in:
parent
94802d3518
commit
38ec3fb080
@ -2486,9 +2486,8 @@ function forum_count_discussion_replies($forumid, $forumsort="", $limit=-1, $pag
|
||||
FROM {forum_posts} p
|
||||
JOIN {forum_discussions} d ON p.discussion = d.id
|
||||
WHERE d.forum = ?
|
||||
GROUP BY p.discussion $groupby
|
||||
$orderby";
|
||||
return $DB->get_records_sql("SELECT * FROM ($sql) sq", array($forumid), $limitfrom, $limitnum);
|
||||
GROUP BY p.discussion $groupby $orderby";
|
||||
return $DB->get_records_sql($sql, array($forumid), $limitfrom, $limitnum);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user