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

'ORA-00918: column ambiguously defined' when viewing participants list

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      • Behat tests
        • Ensure the user/ behat tests run successfully.
        • Ensure the report/log/tests/behat/user_log.feature behat test runs successfully (this was the behat test that failed which caused this issue to be created).
      • Manual tests
        • Create a course and enrol some users in it.
        • View the participants page and ensure the page loads without error with each of the databases (oracle/mysql need to be checked at minimum).
      Show
      Behat tests Ensure the user/ behat tests run successfully. Ensure the report/log/tests/behat/user_log.feature behat test runs successfully (this was the behat test that failed which caused this issue to be created). Manual tests Create a course and enrol some users in it. View the participants page and ensure the page loads without error with each of the databases (oracle/mysql need to be checked at minimum).
    • Affected Branches:
      MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-47689-master

      Description

      When running on oracle we have a DB error:

      02. Moodle exception: Error reading from database More information about this error
          
          Debug info:
           ORA-00918: column ambiguously defined
          SELECT *
                                FROM (SELECT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.username,u.city,u.country,u.lang,u.timezone,u.maildisplay, COALESCE(ul.timeaccess, 0) AS lastaccess, u.email, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance FROM a_user u
          JOIN (SELECT DISTINCT eu1_u.id
                        FROM a_user eu1_u
                      JOIN a_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
          JOIN a_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = :o_eu1_courseid)
                     WHERE eu1_u.deleted = 0 AND eu1_u.id <> :o_eu1_guestid AND eu1_ue.status = :o_eu1_active AND eu1_e.status = :o_eu1_enabled AND eu1_ue.timestart < :o_eu1_now1 AND (eu1_ue.timeend = 0 OR eu1_ue.timeend > :o_eu1_now2)) e ON e.id = u.id
          LEFT JOIN a_user_lastaccess ul ON (ul.userid = u.id AND ul.courseid = :o_courseid)
          LEFT JOIN a_context ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = :o_contextlevel)  )
                               WHERE rownum <= :o_oracle_num_rows
          [array (
            'o_eu1_courseid' => '154000',
            'o_eu1_guestid' => '1',
            'o_eu1_active' => 0,
            'o_eu1_enabled' => 0,
            'o_eu1_now1' => 1413335100,
            'o_eu1_now2' => 1413335100,
            'o_courseid' => '154000',
            'o_contextlevel' => 30,
            'o_oracle_num_rows' => 20,
          )]
          Error code: dmlreadexception
          
          Stack trace:
           
          line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 271 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
          line 1092 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
          line 495 of /user/index.php: call to oci_native_moodle_database->get_recordset_sql()
          In step `And I navigate to "Participants" node in "Current course > C1"'.      # behat_navigation::i_navigate_to_node_in()
          From scenario `Filter log report for standard and legacy log reader'.          # /Users/danp/moodles/im/moodle/report/log/tests/behat/filter_log.feature:21
          Of feature `In a report, admin can filter log data'.                           # /Users/danp/moodles/im/moodle/report/log/tests/behat/filter_log.feature
       
      03. Moodle exception: Error reading from database More information about this error
          
          Debug info:
           ORA-00918: column ambiguously defined
          SELECT *
                                FROM (SELECT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.username,u.city,u.country,u.lang,u.timezone,u.maildisplay, COALESCE(ul.timeaccess, 0) AS lastaccess, u.email, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance FROM a_user u
          JOIN (SELECT DISTINCT eu1_u.id
                        FROM a_user eu1_u
                      JOIN a_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
          JOIN a_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = :o_eu1_courseid)
                     WHERE eu1_u.deleted = 0 AND eu1_u.id <> :o_eu1_guestid AND eu1_ue.status = :o_eu1_active AND eu1_e.status = :o_eu1_enabled AND eu1_ue.timestart < :o_eu1_now1 AND (eu1_ue.timeend = 0 OR eu1_ue.timeend > :o_eu1_now2)) e ON e.id = u.id
          LEFT JOIN a_user_lastaccess ul ON (ul.userid = u.id AND ul.courseid = :o_courseid)
          LEFT JOIN a_context ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = :o_contextlevel)  )
                               WHERE rownum <= :o_oracle_num_rows
          [array (
            'o_eu1_courseid' => '154000',
            'o_eu1_guestid' => '1',
            'o_eu1_active' => 0,
            'o_eu1_enabled' => 0,
            'o_eu1_now1' => 1413335200,
            'o_eu1_now2' => 1413335200,
            'o_courseid' => '154000',
            'o_contextlevel' => 30,
            'o_oracle_num_rows' => 20,
          )]
          Error code: dmlreadexception
          
          Stack trace:
           
          line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 271 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
          line 1092 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
          line 495 of /user/index.php: call to oci_native_moodle_database->get_recordset_sql()
          In step `And I navigate to "Participants" node in "Current course > C1"'.      # behat_navigation::i_navigate_to_node_in()
          From scenario `Filter log report for standard log reader'.                     # /Users/danp/moodles/im/moodle/report/log/tests/behat/filter_log.feature:46
          Of feature `In a report, admin can filter log data'.                           # /Users/danp/moodles/im/moodle/report/log/tests/behat/filter_log.feature
       
      04. Moodle exception: Error reading from database More information about this error
          
          Debug info:
           ORA-00918: column ambiguously defined
          SELECT *
                                FROM (SELECT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.username,u.city,u.country,u.lang,u.timezone,u.maildisplay, COALESCE(ul.timeaccess, 0) AS lastaccess, u.email, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance FROM a_user u
          JOIN (SELECT DISTINCT eu1_u.id
                        FROM a_user eu1_u
                      JOIN a_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
          JOIN a_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = :o_eu1_courseid)
                     WHERE eu1_u.deleted = 0 AND eu1_u.id <> :o_eu1_guestid AND eu1_ue.status = :o_eu1_active AND eu1_e.status = :o_eu1_enabled AND eu1_ue.timestart < :o_eu1_now1 AND (eu1_ue.timeend = 0 OR eu1_ue.timeend > :o_eu1_now2)) e ON e.id = u.id
          LEFT JOIN a_user_lastaccess ul ON (ul.userid = u.id AND ul.courseid = :o_courseid)
          LEFT JOIN a_context ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = :o_contextlevel)  )
                               WHERE rownum <= :o_oracle_num_rows
          [array (
            'o_eu1_courseid' => '154000',
            'o_eu1_guestid' => '1',
            'o_eu1_active' => 0,
            'o_eu1_enabled' => 0,
            'o_eu1_now1' => 1413335300,
            'o_eu1_now2' => 1413335300,
            'o_courseid' => '154000',
            'o_contextlevel' => 30,
            'o_oracle_num_rows' => 20,
          )]
          Error code: dmlreadexception
          
          Stack trace:
           
          line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 271 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
          line 1092 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
          line 495 of /user/index.php: call to oci_native_moodle_database->get_recordset_sql()
          In step `And I navigate to "Participants" node in "Current course > C1"'.      # behat_navigation::i_navigate_to_node_in()
          From scenario `View Todays' and all log report for user'.                      # /Users/danp/moodles/im/moodle/report/log/tests/behat/user_log.feature:38
          Of feature `User can view activity log.'.                                      # /Users/danp/moodles/im/moodle/report/log/tests/behat/user_log.feature
       
      05. Moodle exception: Error reading from database More information about this error
          
          Debug info:
           ORA-00918: column ambiguously defined
          SELECT *
                                FROM (SELECT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.username,u.city,u.country,u.lang,u.timezone,u.maildisplay, COALESCE(ul.timeaccess, 0) AS lastaccess, u.email, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance FROM a_user u
          JOIN (SELECT DISTINCT eu1_u.id
                        FROM a_user eu1_u
                      JOIN a_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
          JOIN a_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = :o_eu1_courseid)
                     WHERE eu1_u.deleted = 0 AND eu1_u.id <> :o_eu1_guestid AND eu1_ue.status = :o_eu1_active AND eu1_e.status = :o_eu1_enabled AND eu1_ue.timestart < :o_eu1_now1 AND (eu1_ue.timeend = 0 OR eu1_ue.timeend > :o_eu1_now2)) e ON e.id = u.id
          LEFT JOIN a_user_lastaccess ul ON (ul.userid = u.id AND ul.courseid = :o_courseid)
          LEFT JOIN a_context ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = :o_contextlevel)  )
                               WHERE rownum <= :o_oracle_num_rows
          [array (
            'o_eu1_courseid' => '154000',
            'o_eu1_guestid' => '1',
            'o_eu1_active' => 0,
            'o_eu1_enabled' => 0,
            'o_eu1_now1' => 1413335400,
            'o_eu1_now2' => 1413335400,
            'o_courseid' => '154000',
            'o_contextlevel' => 30,
            'o_oracle_num_rows' => 20,
          )]
          Error code: dmlreadexception
          
          Stack trace:
           
          line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 271 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
          line 1092 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
          line 495 of /user/index.php: call to oci_native_moodle_database->get_recordset_sql()
          In step `And I navigate to "Participants" node in "Current course > C1"'.           # behat_navigation::i_navigate_to_node_in()
          From scenario `No log reader enabled should be visible when no log store enabled.'. # /Users/danp/moodles/im/moodle/report/log/tests/behat/user_log.feature:49
          Of feature `User can view activity log.'.                                           # /Users/danp/moodles/im/moodle/report/log/tests/behat/user_log.feature
       
      06. Moodle exception: Error reading from databaseMore information about this error
          
          Debug info:
           ORA-00918: column ambiguously defined
          SELECT *
                                FROM (SELECT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email,u.username,u.city,u.country,u.lang,u.timezone,u.maildisplay, COALESCE(ul.timeaccess, 0) AS lastaccess, u.email, ctx.id AS ctxid, ctx.path AS ctxpath, ctx.depth AS ctxdepth, ctx.contextlevel AS ctxlevel, ctx.instanceid AS ctxinstance FROM a_user u
          JOIN (SELECT DISTINCT eu1_u.id
                        FROM a_user eu1_u
                      JOIN a_user_enrolments eu1_ue ON eu1_ue.userid = eu1_u.id
          JOIN a_enrol eu1_e ON (eu1_e.id = eu1_ue.enrolid AND eu1_e.courseid = :o_eu1_courseid)
                     WHERE eu1_u.deleted = 0 AND eu1_u.id <> :o_eu1_guestid AND eu1_ue.status = :o_eu1_active AND eu1_e.status = :o_eu1_enabled AND eu1_ue.timestart < :o_eu1_now1 AND (eu1_ue.timeend = 0 OR eu1_ue.timeend > :o_eu1_now2)) e ON e.id = u.id
          LEFT JOIN a_user_lastaccess ul ON (ul.userid = u.id AND ul.courseid = :o_courseid)
          LEFT JOIN a_context ctx ON (ctx.instanceid = u.id AND ctx.contextlevel = :o_contextlevel)  )
                               WHERE rownum <= :o_oracle_num_rows
          [array (
            'o_eu1_courseid' => '154000',
            'o_eu1_guestid' => '1',
            'o_eu1_active' => 0,
            'o_eu1_enabled' => 0,
            'o_eu1_now1' => 1413341100,
            'o_eu1_now2' => 1413341100,
            'o_courseid' => '154000',
            'o_contextlevel' => 30,
            'o_oracle_num_rows' => 20,
          )]
          Error code: dmlreadexception
          
          Stack trace:
           
          line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 271 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
          line 1092 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
          line 495 of /user/index.php: call to oci_native_moodle_database->get_recordset_sql()
          In step `And I click on "Participants" "link" in the "//li[p/span[contains(normalize-space(string(.)), 'Current course')]]" "xpath_element"'. # behat_general::i_click_on_in_the()
          From scenario `Add and configure a block to display on every page and revert back'.                                                           # /Users/danp/moodles/im/moodle/blocks/tests/behat/return_block_original_state.feature:7
          Of feature `The context of a block can always be returned to it's original state.'.                                                           # /Users/danp/moodles/im/moodle/blocks/tests/behat/return_block_original_state.feature
       

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Nov/14