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

SQL query error in load_user_capability()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8
    • Component/s: Roles / Access
    • Labels:
      None
    • Environment:
      Postgres and Oracle
    • Database:
      PostgreSQL, Oracle
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      Last change to the BIG query used in load_user_capability() has changed the GROUP BY sentence leaving some of the fields in the SELECT list out:

      From the first part of the query:
      missing ----> (c1.contextlevel * 100)
      From the second part of the query:
      need table prefix ----> id1, id2
      missing ----> (c1.contextlevel * 100 + c2.contextlevel)

      It's 100% mandatory to group by ALL the fields (expresions) in the SELECT list.

      I'm going to add them to the query right now in order to allow Moodle HEAD to work but I'm not sure if that's the desired logic and order of grouping desired. Please review it!!

        Attachments

          Activity

            People

            Assignee:
            lazyfish Yu Zhang
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              31/Mar/07