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

ORA-0918 when signing in from Mahara (MNET)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.9.7, 1.9.10, 2.0
    • 1.9.11, 2.0
    • Database SQL/XMLDB, MNet
    • Redhat EL5, Oracle 11g, Moodle in combination with Mahara
    • Oracle
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • Easy

    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})";
      **********************************************************

      Attachments

        Issue Links

          Activity

            People

              mudrd8mz David Mudrák (@mudrd8mz)
              hst rik
              Nobody Nobody
              Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Nov/10