Refactoring SQL query in View::shared_to_user() (Bug 1476495)
The old one unnecessarily used two separate queries for Postgres
& MySQL. And it had a bug in how it used MySQL's extended
"GROUP BY" functionality. While MySQL does let you return
non-aggregated columns, it uses an arbitrary record for these of
them, NOT the first record according to ORDER BY.
Also restructured the query a bit for optimization purposes.
Reviewed: https:/ /reviews. mahara. org/5000 /git.nzoss. org.nz/ mahara/ mahara/ commit/ 462b1c471c851c1 093797f99fbc2bc 798c396c3a
Committed: https:/
Submitter: Aaron Wells (<email address hidden>)
Branch: master
commit 462b1c471c851c1 093797f99fbc2bc 798c396c3a
Author: Aaron Wells <email address hidden>
Date: Mon Jul 20 19:39:17 2015 +1200
Refactoring SQL query in View::shared_ to_user( ) (Bug 1476495)
The old one unnecessarily used two separate queries for Postgres
& MySQL. And it had a bug in how it used MySQL's extended
"GROUP BY" functionality. While MySQL does let you return
non-aggregated columns, it uses an arbitrary record for these of
them, NOT the first record according to ORDER BY.
Also restructured the query a bit for optimization purposes.
behatnotneeded (Test in subsequent patch)
Change-Id: I3d49292025dcf7 ac510a84d7e8004 76defec0525