Moodle
  1. Moodle
  2. MDL-26594

Error with "Course completion" block on Oracle 10g

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.3
    • Component/s: Course completion
    • Labels:
    • Environment:
      CentOS 5.5, Oracle 10g, PHP 5.3.5 with oci8 library
    • Database:
      Oracle
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      When inserted a "Course completion" block in a course, an error is generated, stating taht a reserved word in Oracle is used as variable name in the query.
      The name is "USER".
      The soution is to change the lines 980 ans 983 of file lib/completionlib.php changing the name "user" to anything else (I used "userid" for readibility).
      I atteched the modified version of the file for reference.

        Gliffy Diagrams

          Activity

          Hide
          Helen Foster added a comment -

          Luca, thanks for your report and suggested fix.

          Reassigning to course completion component lead, Aaron and adding Oracle expert Aparup as a watcher.

          Show
          Helen Foster added a comment - Luca, thanks for your report and suggested fix. Reassigning to course completion component lead, Aaron and adding Oracle expert Aparup as a watcher.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          If, for any reason, Aaron isn't able to get this along the very-next days... Aparup could you pick it for next sprint?

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - If, for any reason, Aaron isn't able to get this along the very-next days... Aparup could you pick it for next sprint? TIA and ciao
          Hide
          Aparup Banerjee added a comment -

          there so many of these reserved words in oracle... http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/ap_keywd.htm#SQLRF022

          should we consider using double quotes in the oracle driver to escape these? http://www.techonthenet.com/oracle/errors/ora01747.php

          or stick with renaming column names in moodle?

          Show
          Aparup Banerjee added a comment - there so many of these reserved words in oracle... http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/ap_keywd.htm#SQLRF022 should we consider using double quotes in the oracle driver to escape these? http://www.techonthenet.com/oracle/errors/ora01747.php or stick with renaming column names in moodle?
          Hide
          Aparup Banerjee added a comment -
          Show
          Aparup Banerjee added a comment - code for fix up here https://github.com/nebgor/moodle/compare/mistress...MDL-26594
          Hide
          Aparup Banerjee added a comment -

          ok, tested that this fix works, thanks Luca!

          Show
          Aparup Banerjee added a comment - ok, tested that this fix works, thanks Luca!
          Hide
          Helen Foster added a comment -

          Apu, thanks for fixing this issue.

          The fix is included in the latest 2.0.2+.

          Show
          Helen Foster added a comment - Apu, thanks for fixing this issue. The fix is included in the latest 2.0.2+.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: