Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-3907

LDAP sync_users problem with SQL

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not a bug
    • 1.5.2
    • None
    • Enrolments
    • 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.

      Attachments

        Activity

          People

            danmarsden Dan Marsden
            jgraham Jeff Graham
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: