Commit 2bc9d3aa authored by Robert Lyon's avatar Robert Lyon Committed by Cecilia Vela Gurovic
Browse files

Bug 1769512: Need to nest the query better for mysql to handle



Otherwise the query just hangs

behatnotneeded

Change-Id: If3d022f87f83e14a512527a47cca2093b2ba74aa
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
(cherry picked from commit 94c1c750)
parent 12cd2e9c
......@@ -185,10 +185,12 @@ class User {
FROM
{usr} u
WHERE u.id IN (
SELECT u.id FROM {usr} u
JOIN {artefact} a ON a.owner = u.id
JOIN {artefact_internal_profile_email} ae ON (ae.owner = u.id and ae.artefact = a.id)
WHERE a.artefacttype = ? AND (LOWER(u.email) = ? OR LOWER(a.title) = ?) GROUP BY u.id
SELECT id FROM (
SELECT u2.id FROM {usr} u2
JOIN {artefact} a ON a.owner = u2.id
JOIN {artefact_internal_profile_email} ae ON (ae.owner = u2.id and ae.artefact = a.id)
WHERE a.artefacttype = ? AND (LOWER(u2.email) = ? OR LOWER(a.title) = ?) GROUP BY u2.id
) AS f
)';
$user = get_record_sql($sql, array('email', $email, $email));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment