Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0.2
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
    • Environment:
      oracle
    • Database:
      Oracle
    • Affected Branches:
      MOODLE_20_STABLE
    • Rank:
      16438

      Description

      While testing PULL-423 (see http://tracker.moodle.org/browse/PULL-423?focusedCommentId=106553&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-106553), oracle/mod/quiz/report.php errored with:

      Debug info: ORA-00918: column ambiguously defined
      SELECT u.id || '#' || COALESCE(qa.attempt, 0) AS concattedid, (CASE WHEN qa.sumgrades = (SELECT MAX(qa2.sumgrades) FROM m_quiz_attempts qa2 WHERE qa2.quiz = qa.quiz AND qa2.userid = qa.userid) AND qa.timestart = (SELECT MIN(qa3.timestart) FROM m_quiz_attempts qa3 WHERE qa3.quiz = qa.quiz AND qa3.userid = qa.userid AND qa3.sumgrades = qa.sumgrades) THEN 1 ELSE 0 END) AS gradedattempt, qa.uniqueid,
      qa.id AS attempt,
      u.id AS userid,
      u.idnumber,
      u.firstname,
      u.lastname,
      u.picture,
      u.imagealt,
      u.email,
      u.institution,
      u.department,
      qa.sumgrades,
      qa.timefinish,
      qa.timestart,
      qa.timefinish - qa.timestart AS duration,
      CASE WHEN qa.timefinish = 0 THEN null
      WHEN qa.timefinish > qa.timestart THEN qa.timefinish - qa.timestart
      ELSE 0 END AS duration FROM m_user u LEFT JOIN m_quiz_attempts qa ON qa.userid = u.id AND qa.quiz = :quizid WHERE qa.id IS NOT NULL AND qa.preview = 0 ORDER BY concattedid ASC
      [array (
      'quizid' => '21',
      'oracle_num_rows' => 30,
      )]
      Stack trace:
      line 391 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 1042 of \lib\dml\oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
      line 1354 of \lib\tablelib.php: call to oci_native_moodle_database->get_records_sql()
      line 244 of \mod\quiz\report\responses\responses_table.php: call to table_sql->query_db()
      line 1375 of \lib\tablelib.php: call to quiz_report_responses_table->query_db()
      line 348 of \mod\quiz\report\responses\report.php: call to table_sql->out()
      line 90 of \mod\quiz\report.php: call to quiz_responses_report->display()

        Issue Links

          Activity

          Hide
          Tim Hunt added a comment -

          Thank you, Oracle, for telling my which column you think is ambiguous. As far as I can see, every column name used in this query is qualified by a table prefix. Grrrr!

          I don't have an Oracle database I can develop/test on. So someone needs to tell me which bit of the query is causing the problem. Given the useless error message, I suspect we will need to start deleting parts of the query, and use that as a way to find out which bit causes the problem.

          Show
          Tim Hunt added a comment - Thank you, Oracle, for telling my which column you think is ambiguous. As far as I can see, every column name used in this query is qualified by a table prefix. Grrrr! I don't have an Oracle database I can develop/test on. So someone needs to tell me which bit of the query is causing the problem. Given the useless error message, I suspect we will need to start deleting parts of the query, and use that as a way to find out which bit causes the problem.
          Hide
          Aparup Banerjee added a comment -

          grr, seems to be the extra param 'oracle_num_rows' from the oracle driver that is the issue (causing ambiguity).. the query runs fine when put thru directly to oracle.

          Show
          Aparup Banerjee added a comment - grr, seems to be the extra param 'oracle_num_rows' from the oracle driver that is the issue (causing ambiguity).. the query runs fine when put thru directly to oracle.
          Hide
          Tim Hunt added a comment -

          OK. That sounds like an Eloy problem then. Thanks for working that out Apu.

          Show
          Tim Hunt added a comment - OK. That sounds like an Eloy problem then. Thanks for working that out Apu.
          Hide
          Aparup Banerjee added a comment -

          linking some very similar 'oracle_num_rows' ambiguous errors.

          Show
          Aparup Banerjee added a comment - linking some very similar 'oracle_num_rows' ambiguous errors.
          Hide
          Sam Hemelryk added a comment -

          Just noting I couldn't reproduce this with 2.4dev + Oracle 11g.2 express + WinXP.

          Show
          Sam Hemelryk added a comment - Just noting I couldn't reproduce this with 2.4dev + Oracle 11g.2 express + WinXP.
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting this issue.

          We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported.

          If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

          Michael d.

          TW9vZGxlDQo=

          Show
          Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d. TW9vZGxlDQo=
          Hide
          Tim Hunt added a comment -

          Closing as per Sam's last comment.

          Show
          Tim Hunt added a comment - Closing as per Sam's last comment.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: