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

ORA-0918 when signing in from Mahara (MNET)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9.7, 1.9.10, 2.0
    • Fix Version/s: 1.9.11, 2.0
    • Component/s: Database SQL/XMLDB, MNet
    • Labels:
    • Environment:
      Redhat EL5, Oracle 11g, Moodle in combination with Mahara
    • Database:
      Oracle
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      In ./mnet/xmlrpc/client.php an invalid SQL is used which results in an ORA-0918 error (column ambiguesly defined).

      this is caused by the statement:

      **********************************************************
      // Find methods that we subscribe to on this host
      $sql = "
      SELECT *
      FROM
      {$CFG->prefix}mnet_rpc r,
      {$CFG->prefix}mnet_service2rpc s2r,
      {$CFG->prefix}mnet_host2service h2s
      WHERE
      r.xmlrpc_path = '{$this->method}' AND
      s2r.rpcid = r.id AND
      s2r.serviceid = h2s.serviceid AND
      h2s.subscribe = '1' AND
      h2s.hostid in ({$id_list})";
      **********************************************************

      Since columns like 'ID' exist in mnet_rpc AND mnet_service2rpc AND in mnet_host2service, this results in ORA-0918. The correct statedment should be:

      **********************************************************
      // Find methods that we subscribe to on this host
      $sql = "
      SELECT r.id
      ,r.function_name
      ,r.xmlrpc_path
      ,r.parent_type
      ,r.parent
      ,r.enabled
      ,r.profile
      ,s2r.id s2r_id
      ,s2r.serviceid
      ,s2r.rpcid
      ,h2s.hostid
      ,h2s.id h2s_id
      ,h2s.serviceid h2s_serviceid
      ,h2s.subscribe
      FROM
      {$CFG->prefix}mnet_rpc r,
      {$CFG->prefix}mnet_service2rpc s2r,
      {$CFG->prefix}mnet_host2service h2s
      WHERE
      r.xmlrpc_path = '{$this->method}' AND
      s2r.rpcid = r.id AND
      s2r.serviceid = h2s.serviceid AND
      h2s.subscribe = '1' AND
      h2s.hostid in ({$id_list})";
      **********************************************************

        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:
                    24/Nov/10