MDL-38215 Fix cross-db support in workshop SQL queries
commite8c660394d07a4e87a061f8ff4f87d3936b0b0e7
authorDavid Mudrák <david@moodle.com>
Wed, 13 Mar 2013 13:24:16 +0000 (13 14:24 +0100)
committerDavid Mudrák <david@moodle.com>
Wed, 13 Mar 2013 14:04:37 +0000 (13 15:04 +0100)
tree8c2900edc4d2d8abc82cd18d40eecfda5cc08bba
parent5c8860f73573b7a652c1b737c1c3b87621cfacc4
MDL-38215 Fix cross-db support in workshop SQL queries

The $sql used in these methods may contain multiple parts glued
together by the UNION operator. Simply appending the ORDER BY statement
to the end of the query does not work in all DBs (failure reported at
Oracle). Following the pattern already applied in MDL-30051, we wrap the
SQL into yet another SELECT statement and perform ordering there.

Credit goes to Sara Cenni for suggesting the fix.
mod/workshop/locallib.php