Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Not a bug
-
1.5.2
-
None
-
None
-
Linux
-
MySQL
-
MOODLE_15_STABLE
Description
The SQL in the function sync_users() is problematic mysql version 3.23.58 throws an error however it works fine in 4.1.10.
The following is the SQL it tries to execute I've replaced the user idnumber with #FIELD#
SELECT enr.userid AS user, 1
FROM mdl_user_teachers enr
JOIN mdl_user usr ON usr.id=enr.userid
WHERE course=452
AND enrol='ldap'
AND usr.idnumber NOT IN ('#FIELD#')
This code doesn't work however changing it to the following works;
SELECT enr.userid AS user, 1
FROM mdl_user_teachers enr, mdl_user usr
WHERE usr.id=enr.userid
AND course=452
AND enrol='ldap'
AND usr.idnumber NOT IN ('#FIELD#')
is there any reason I'm not seeing for the join? I think the first example (the existing code) is not as portable as the second.