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

get_role_users() can generate SQL error on MS-SQL

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.2.2, 2.3.2
    • None
    • Enrolments
    • Microsoft SQL
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • Easy

    Description

      get_role_users() takes the paramater $sort. According to the comments above this function it can be used to "sort from user (u.) , role assignment (ra) or role (r.)". But when running Moodle on Microsoft SQL it is possible to generate an SQL error when sorting by a field which is not within the user table. The following was generated when using "ra.timemodified" as $sort:

      "Debug info: ORDER BY items must appear in the select list if SELECT DISTINCT is specified."

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              markdw Mark Ward
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: