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

Site registration fails on Oracle

    Details

    • Database:
      Oracle
    • Testing Instructions:
      Hide

      While using a site running under Oracle
      Access the site registration page from the Settings block (Site Administration -> Registration)

      Show
      While using a site running under Oracle Access the site registration page from the Settings block (Site Administration -> Registration)
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE

      Description

      Bad SQL in course/lib.php functions average_number_of_participants() and average_number_of_course_modules() will cause the site registration to fail on Oracle (error below).

      Suggest to remove the 'as' preceding subquery alias 'total'

      Without the 'as' it will run correctly on MySQL, PostgreSQL, and Oracle.

      Debug info: ORA-00933: SQL command not properly ended
      SELECT COUNT(*) FROM (
      SELECT DISTINCT ue.userid, e.courseid
      FROM p_user_enrolments ue, p_enrol e, p_course c
      WHERE ue.enrolid = e.id
      AND e.courseid <> :o_siteid
      AND c.id = e.courseid
      AND c.visible = 1) as total
      [array (
      'o_siteid' => '1',
      )]
      Error code: dmlreadexception
      Stack trace:
       
          line 407 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 284 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
          line 1111 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
          line 1337 of /lib/dml/moodle_database.php: call to oci_native_moodle_database->get_records_sql()
          line 1045 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->get_record_sql()
          line 1410 of /lib/dml/moodle_database.php: call to oci_native_moodle_database->get_record_sql()
          line 1581 of /lib/dml/moodle_database.php: call to moodle_database->get_field_sql()
          line 4038 of /course/lib.php: call to moodle_database->count_records_sql()
          line 373 of /admin/registration/forms.php: call to average_number_of_participants()
          line 173 of /lib/formslib.php: call to site_registration_form->definition()
          line 61 of /admin/registration/register.php: call to moodleform->moodleform()

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    10/Sep/12