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

Question restore for qtype_match fails in Oracle when question is longer than 4000 chars

    XMLWordPrintable

    Details

    • Database:
      Oracle
    • Affected Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:
      MDL-47176_master
    • Testing Instructions:
      Hide

      Using Oracle:

      1. Create a matching question where the text of one of the subquestions is longer than 4kb.
      2. Add that question to a quiz.
      3. Duplicate the quiz in the course.
      4. Verify that it works.
      Show
      Using Oracle: Create a matching question where the text of one of the subquestions is longer than 4kb. Add that question to a quiz. Duplicate the quiz in the course. Verify that it works.

      Description

      Importing match question types from another course with images in the questiontext.
      It fails in line 136 of /question/type/match/backup/moodle2/restore_qtype_match_plugin.class.php: call to moodle_database->get_record_select()
      The comparison of strings fails with this error:

      ORA-01460: unimplemented or unreasonable conversion requested
       
      SELECT id FROM m2qtype_match_subquestions WHERE questionid = :o_param1 AND dbms_lob.substr(questiontext, 32,1) = dbms_lob.substr(:o_param2, 32,1) AND answertext = :o_param3
      [array (
      'o_param1' => '2811',
      'o_param2' => '<p><img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQTEhUUEhQVFRQXFRQXFRUUFRQUFRQUFRQWGBQUFBQYHCggGBolHBQVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGiwkHxwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLP/AABEIAMUBAAMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAADBAIFBgABB//EADsQAAEDAgQEAwYFAwQCAwAAAAEAAhEDBAUSITFBUWFxBoGREyIyobHwQlLB0eEUI2IVM3KCJPEWktL/xAAYAQADAQEAAAAAAAAAAAAAAAAAAQIDBP/EACMRAQEAAgICAwADAQEAAAAAAAABAhEDI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NUsUcNCQe+6qGYg08QvH3Q5j1Tm5R1WPqWdRmpBXtrU1+ItPRabNI1SV3ZU4JAAI5Lvt25YWZVIE5/NwDgPI6pd1R52fpG+Uie2qGYG/32Rc4O48pgeaz1pYH9ETrI6k7IVS0jYz9AnQwTrEchsENrcxIaJ7cFXlS0QLUJy0NLDwR75A6BArYe07CETlguFVTApwn7fDiRA3Xpwupwaq8oWlfCjCuKWA1TwATI8MVPzBHkNM9C9pwDrt0Wnp+GPzH0QLzw/lBIdtzR5QaJU67RGRsugnQAeoRv6hzmnK1rfzFpIPmIQXMDSABrz5Hoj1nufqeH5REDrzWN00iusWy4k6/wDL903Xq0tjB6tMj+VCpajckO5aQD81IFrR7oHnz5qrZbsp0Vd7ITu46wNh8kB9GBJInlCNUe1ogRPEpYNJ1grSIrmhFpVS0yDCsKGB1HCYjvuhVsMe3gi2ArVqlxLidTuho5t3ciu/p3flKJoGKGMvaIIDuUiCPMINbF6ky05Z3G/1S76RHBL1AiYY/guVFfePd8Tifp6IWZQamKdIq+onuuFy8bOPquYHO11Pmjim3f6heiR8PylRv8VoH3+Z817DuLkRzj08tCoitHAICyFYryq8wuXLJVKv13UvYaTJ7HX5rlyrYe2zC73p2GgiUaxqEA83HUrlyWX2IM53CFIPnyXLlmoxRMHTRWVvdHkuXIxFWDHKeZeLlcpBuqqoxS4J04L1clkeJAMa7RwlBqNLCYO208uXULlynH3o6CKscAg1nye3WfNcuWsiHmH27ajnZthwCsHGC2Bt+i5cozv9tKx/5X1GqS0HopZ1y5VCCqAckN2nBcuTIjeMB3Cz9egC6Fy5OJNUbVuyjXEQOC5cpl7UFGq7MvFyskQ5RO65cmT/2Q==" style="width: 254px; height: 195px; margin-left: 0px; margin-right: 0px; margin-top: 0px;" class="rg_i" name="GzdbCyHoz3-vqM:" data-sz="f" /></p>',
      'o_param3' => 'Personificación',
      )]
      Error code: dmlreadexception
       
      Stack trace:
      line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 271 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
      line 1104 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
      line 1064 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->get_recordset_sql()
      line 1400 of /lib/dml/moodle_database.php: call to oci_native_moodle_database->get_record_sql()
      line 136 of /question/type/match/backup/moodle2/restore_qtype_match_plugin.class.php: call to moodle_database->get_record_select()
      line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_qtype_match_plugin->process_match()
      line 103 of /backup/util/helper/restore_structure_parser_processor.class.php: call to restore_structure_step->process()
      line 151 of /backup/util/xml/parser/processors/grouped_parser_processor.class.php: call to restore_structure_parser_processor->dispatch_chunk()
      line 91 of /backup/util/helper/restore_structure_parser_processor.class.php: call to grouped_parser_processor->postprocess_chunk()
      line 148 of /backup/util/xml/parser/processors/simplified_parser_processor.class.php: call to restore_structure_parser_processor->postprocess_chunk()
      line 92 of /backup/util/xml/parser/processors/progressive_parser_processor.class.php: call to simplified_parser_processor->process_chunk()
      line 186 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser_processor->receive_chunk()
      line 274 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->publish()
      line ? of unknownfile: call to progressive_parser->end_tag()
      line 175 of /backup/util/xml/parser/progressive_parser.class.php: call to xml_parse()
      line 154 of /backup/util/xml/parser/progressive_parser.class.php: call to progressive_parser->parse()
      line 110 of /backup/util/plan/restore_structure_step.class.php: call to progressive_parser->process()
      line 181 of /backup/util/plan/base_task.class.php: call to restore_structure_step->execute()
      line 177 of /backup/util/plan/base_plan.class.php: call to base_task->execute()
      line 167 of /backup/util/plan/restore_plan.class.php: call to base_plan->execute()
      line 333 of /backup/controller/restore_controller.class.php: call to restore_plan->execute()
      line 163 of /backup/import.php: call to restore_controller->execute_plan()
      

      This error does not happen if the string is shorter than 4000 characters:
      The function that raises the error is dbms_lob.substr(:o_param2, 32,1)

        Attachments

          Activity

            People

            Assignee:
            pferre22 Pau Ferrer
            Reporter:
            pferre22 Pau Ferrer
            Peer reviewer:
            Tim Hunt Tim Hunt
            Integrator:
            Dan Poltawski Dan Poltawski
            Tester:
            Rajesh Taneja Rajesh Taneja
            Participants:
            Component watchers:
            Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Tim Hunt, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              12/Jan/15