Moodle
  1. Moodle
  2. MDL-22241

Oracle error in questiontype.php on line 919 (invalid character)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 1.9.9
    • Component/s: Quiz
    • Labels:
      None
    • Environment:
      Redhat Linux, Oracle 11g
    • Database:
      Oracle
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      26205

      Description

      There is an error in the sql where a semi-colan has been accidently placed into the questiontype.php file on like 919. I have removed this error and uploaded a patch for the fix

      Reproduce :

      Go into a quiz and try to create a new question eg http://moodle-techdev.cqu.edu.au/question/question.php is the page that will cause the error.

      Thu Apr 29 11:54:19 2010] [error] [client 138.77.10.72] SQL ORA-00911: invalid character in /usr/local/moodle-core/releases/rel-20100113-8/lib/dmllib.php on line 966. STATEMENT: SELECT i.,d. FROM m_question_datasets d, m_question_dataset_definitions i WHERE i.id = d.datasetdefinition AND i.category = 8349; with limits (, ), referer: http://moodle.cqu.edu.au/question/question.php?returnurl=http%3A%2F%2Fmoodle.cqu.edu.au%2Fmod%2Fquiz%2Fedit.php%3Fqpage%3D0%26amp%3Bcat%3D8349%252C17241%26amp%3Bcmid%3D58047&cmid=58047&id=54247

        Activity

        Hide
        David Binney added a comment -

        I did not catch all the errors in the first patch so use the ...-update.patch file for the full fix

        Show
        David Binney added a comment - I did not catch all the errors in the first patch so use the ...-update.patch file for the full fix
        Hide
        Tim Hunt added a comment -

        Thanks for finding and fixing this David.

        Pierre. You must not have a ; at the end of DB queries in Moodle code.

        Show
        Tim Hunt added a comment - Thanks for finding and fixing this David. Pierre. You must not have a ; at the end of DB queries in Moodle code.
        Hide
        Pierre Pichet added a comment -

        Sorry,
        This was my second CVS in moodle back to 2007-06-10
        as ; is not a problem at least in MySQL syntax , this go unnoticed until now.
        I have looked at my other files and there seem to be no more

        Show
        Pierre Pichet added a comment - Sorry, This was my second CVS in moodle back to 2007-06-10 as ; is not a problem at least in MySQL syntax , this go unnoticed until now. I have looked at my other files and there seem to be no more
        Hide
        David Binney added a comment -

        You are correct in that ";" is an accurate sql query in any db however once it passes though adobo i think that is appended anyway so i think mysql was just being nice in not mentioning that there were two ;; on the end of the string?? Only a guess though and consistency is a good thing too

        Show
        David Binney added a comment - You are correct in that ";" is an accurate sql query in any db however once it passes though adobo i think that is appended anyway so i think mysql was just being nice in not mentioning that there were two ;; on the end of the string?? Only a guess though and consistency is a good thing too
        Hide
        Pierre Pichet added a comment - - edited

        line 1755 and following

                    $sql = "SELECT i.*,d.*
                            FROM {question_datasets} d,
                                 {question_dataset_definitions} i
                          WHERE i.id = d.datasetdefinition
                            AND i.category = ?
                            ;
                           ";
        

        which on 1 line is

                    $sql = "SELECT i.*,d.* FROM {question_datasets} d, {question_dataset_definitions} i WHERE i.id = d.datasetdefinition AND i.category = ? ; ";
        
        

        there is only one ; in the $sql string

        I think that this is more related to new DB queries in Moodle code.

        Show
        Pierre Pichet added a comment - - edited line 1755 and following $sql = "SELECT i.*,d.* FROM {question_datasets} d, {question_dataset_definitions} i WHERE i.id = d.datasetdefinition AND i.category = ? ; "; which on 1 line is $sql = "SELECT i.*,d.* FROM {question_datasets} d, {question_dataset_definitions} i WHERE i.id = d.datasetdefinition AND i.category = ? ; " ; there is only one ; in the $sql string I think that this is more related to new DB queries in Moodle code.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: