New cross-db version of the big union query used by get_my_courses() function. I've tested both the "IN" subquery and the "FROM" subquery and, under sites with more courses, the "FROM" one seems to perform slightly better. MDL-9381
New cross-db version of the big union query used by get_my_courses() function.
I've tested both the "IN" subquery and the "FROM" subquery and, under sites
with more courses, the "FROM" one seems to perform slightly better. MDL-9381

Merged from MOODLE_18_STABLE

dilawar/moodle