Moodle
  1. Moodle
  2. MDL-31804

Grader report generates SQL error on Oracle

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.1
    • Fix Version/s: 2.2.4
    • Component/s: Gradebook
    • Labels:
    • Database:
      Oracle
    • Testing Instructions:
      Hide

      This requires Oracle to really test it properly. Testing in any other DB will at least check nothing was broken.

      Check that the site setting "showuseridentity" has email address ticked.

      Go to the grader report and check that no warnings or errors are displayed.

      Show
      This requires Oracle to really test it properly. Testing in any other DB will at least check nothing was broken. Check that the site setting "showuseridentity" has email address ticked. Go to the grader report and check that no warnings or errors are displayed.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull Master Branch:
      MDL-31804_ambiguous_sql
    • Rank:
      38426

      Description

      With an Oracle database, when the 'Show user identity' setting (User policies) is set to 'Email address' and a teacher views the Grader report, an SQL error is thrown when the 'email' field is included twice:

      Debug info: ORA-00918: column ambiguously defined
      SELECT *
      FROM (SELECT u.id,u.picture,u.firstname,u.lastname,u.imagealt,u.email, email
      FROM z_user u
      JOIN (SELECT DISTINCT eu1_u.id
      ...
      

      It seems to have been introduced in MDL-26647. Patch to come shortly.

        Issue Links

          Activity

          Show
          Jonathon Fowler added a comment - This fixes it for me: https://github.com/jonof/moodle/commit/91b357efc8ec8f154f260bd0f2b746c6042416d9
          Hide
          Michael de Raadt added a comment -

          Hi, Jono.

          Thanks for reporting that and providing a solution.

          Show
          Michael de Raadt added a comment - Hi, Jono. Thanks for reporting that and providing a solution.
          Hide
          Michael de Raadt added a comment -

          Hi, Sam.

          I've just added you as a watcher as you were involved in the original issue.

          Show
          Michael de Raadt added a comment - Hi, Sam. I've just added you as a watcher as you were involved in the original issue.
          Hide
          Michael de Raadt added a comment -

          Jono.

          You can set yourself as assignee and push this to peer review, if you wish.

          Show
          Michael de Raadt added a comment - Jono. You can set yourself as assignee and push this to peer review, if you wish.
          Hide
          Sam Marshall added a comment -

          The change appears correct to me. Assuming that it works, I suggest it could be submitted for integration.

          Show
          Sam Marshall added a comment - The change appears correct to me. Assuming that it works, I suggest it could be submitted for integration.
          Hide
          Andrew Davis added a comment -

          Adding branches. This is only master and 2.2 stable.

          Show
          Andrew Davis added a comment - Adding branches. This is only master and 2.2 stable.
          Hide
          Andrew Davis added a comment -

          Submitting for integration.

          Show
          Andrew Davis added a comment - Submitting for integration.
          Hide
          Dan Poltawski added a comment -

          Thanks everyone, i've integrated this now

          Show
          Dan Poltawski added a comment - Thanks everyone, i've integrated this now
          Hide
          Jason Fowler added a comment -

          looks good to me

          Show
          Jason Fowler added a comment - looks good to me
          Hide
          Eloy Lafuente (stronk7) added a comment -

          U P S T R E A M I Z E D !

          Many thanks for the hard work, closing this as fixed.

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - U P S T R E A M I Z E D ! Many thanks for the hard work, closing this as fixed. Ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: