Moodle
  1. Moodle
  2. MDL-32863

Ambiguous column error when editing a quiz under Oracle

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.1.7, 2.2.4
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. Create a quiz activity in a course (give it a name, choose the 'Save and Display' button).
      2. Choose the 'Edit quiz' button.
      3. Observe a broken page with no quiz page editing controls and an exception in the webserver log.

      Expected result: a properly formed quiz editing page and no exception.

      Show
      1. Create a quiz activity in a course (give it a name, choose the 'Save and Display' button). 2. Choose the 'Edit quiz' button. 3. Observe a broken page with no quiz page editing controls and an exception in the webserver log. Expected result: a properly formed quiz editing page and no exception.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      39926

      Description

      MDL-32239 introduced a regression where the q.id column is included twice in a query when editing a quiz, which breaks on Oracle. The exception below is thrown. Patch forthcoming.

      Default exception handler: Error reading from database Debug: ORA-00918: column ambiguously defined
      SELECT * FROM (
        SELECT q.hidden, q.category, q.id, q.qtype, q.name, q.questiontext, \
          q.questiontextformat, q.id, q.createdby \
        FROM m_question q  WHERE q.parent = 0 AND q.hidden = 0 AND \
          q.category = :o_cat58 ORDER BY q.qtype ASC, q.name ASC \
      ) WHERE rownum <= :o_oracle_num_rows
      [array (
        'o_cat58' => '2',
        'o_oracle_num_rows' => 20,
      )]
      * line 394 of /lib/dml/moodle_database.php: dml_read_exception thrown
      * line 268 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
      * line 1098 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
      * line 1141 of /question/editlib.php: call to oci_native_moodle_database->get_recordset_sql()
      * line 1336 of /question/editlib.php: call to question_bank_view->load_page_questions()
      * line 1194 of /mod/quiz/editlib.php: call to question_bank_view->display_question_list()
      * line 477 of /mod/quiz/edit.php: call to quiz_question_bank_view->display()
      

        Issue Links

          Activity

          Hide
          Michael de Raadt added a comment -

          I noticed this is a duplicate, but I have closed the other issue in favour of this one as a solution is included here.

          Show
          Michael de Raadt added a comment - I noticed this is a duplicate, but I have closed the other issue in favour of this one as a solution is included here.
          Hide
          Jonathon Fowler added a comment -

          Ah, sorry. Clearly my searching skills need work. :-/

          Show
          Jonathon Fowler added a comment - Ah, sorry. Clearly my searching skills need work. :-/
          Hide
          Tim Hunt added a comment -

          Thanks Jonathan. Please can you write some testing instructions before this is integrated.

          Show
          Tim Hunt added a comment - Thanks Jonathan. Please can you write some testing instructions before this is integrated.
          Hide
          Tim Hunt added a comment -

          +1 from me, submitting for integration.

          Show
          Tim Hunt added a comment - +1 from me, submitting for integration.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          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 -

          so I was able to test this in master, but not 2.2 or 2.1, it worked fine in master - will be giving this up to some one else to test more thoroughly, as my oracle setup is a mess.

          Show
          Jason Fowler added a comment - so I was able to test this in master, but not 2.2 or 2.1, it worked fine in master - will be giving this up to some one else to test more thoroughly, as my oracle setup is a mess.
          Hide
          Michael de Raadt added a comment -

          Test result: Success

          I tested this on master, 2.2 and 2.1 under Oracle, SQL Server, MySQL and PostgreSQL.

          I was able to create a quiz, view the edit page and add questions without errors appearing on screen or in the log.

          Show
          Michael de Raadt added a comment - Test result: Success I tested this on master, 2.2 and 2.1 under Oracle, SQL Server, MySQL and PostgreSQL. I was able to create a quiz, view the edit page and add questions without errors appearing on screen or in the log.
          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:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: