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

mod_lti error on restore under oracle database

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      CiBoT will tell us if:

      • This (or complete run) is passing for all databases:
        --tags='@mod_lti&&@core_backup'

      That's all

      Show
      CiBoT will tell us if: This (or complete run) is passing for all databases: --tags='@mod_lti&&@core_backup' That's all
    • Affected Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE
    • Fixed Branches:
      MOODLE_33_STABLE, MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      It seems that, since some weeks ago, we are getting a consistent error with oracle and behat tests:

      $ php admin/tool/behat/cli/run.php --feature=/var/www/html/mod/lti/tests/behat/backup_restore.feature
      Running single behat site:
      Moodle 3.5dev (Build: 20180208), 315a0a3aaf6be4f71362b3e1dd958c69cd464fbd
      Php: 7.2.1, oci: 11.2.0.2.0, OS: Linux 4.9.75-linuxkit-aufs x86_64
      Server OS "Linux", Browser: "firefox"
      Started at 09-02-2018, 20:13
      ............................................F-------------
       
      --- Failed steps:
       
      001 Scenario: Backup and restore course with preconfigured course LTI tool on the same site # /var/www/html/mod/lti/tests/behat/backup_restore.feature:50
            And I restore "test_backup.mbz" backup into "Course 2" course using this options:     # /var/www/html/mod/lti/tests/behat/backup_restore.feature:70
              Moodle exception: Error reading from database More information about this error
              
                  
              ×
                  
              Debug info:
               ORA-00932: inconsistent datatypes: expected - got CLOB
              SELECT id
                          FROM b_lti_types
                          WHERE baseurl = :o_baseurl AND course = :o_course AND name = :o_name AND toolproxyid IS NULL
              [array (
                'o_baseurl' => 'http://www.example.com/lti/provider.php',
                'o_course' => 3,
                'o_name' => 'My course tool',
              )]
              Error code: dmlreadexception
              
              
                  
              ×
                  
              Stack trace:
               
              line 486 of /lib/dml/moodle_database.php: dml_read_exception thrown
              line 277 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
              line 1142 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
              line 1100 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->get_recordset_sql()
              line 183 of /mod/lti/backup/moodle2/restore_lti_stepslib.php: call to oci_native_moodle_database->get_record_sql()
              line 132 of /mod/lti/backup/moodle2/restore_lti_stepslib.php: call to restore_lti_activity_structure_step->find_existing_lti_type()
              line 137 of /backup/util/plan/restore_structure_step.class.php: call to restore_lti_activity_structure_step->process_ltitype()
      ...
      ...
       
      2 scenarios (1 passed, 1 failed)
      58 steps (44 passed, 1 failed, 13 skipped)
      4m9.77s (48.07Mb)
      

      Problem was introduced for 33, 34 and master recently (December 2017) by MDL-34161. Cause being the baseurl = :o_baseurl comparison. They are TEXT (CLOB) fields and it needs sql_compare_text() helper.

      Ciao

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                stronk7 Eloy Lafuente (stronk7)
                Reporter:
                stronk7 Eloy Lafuente (stronk7)
                Peer reviewer:
                Mark Nelson
                Integrator:
                Andrew Nicols
                Tester:
                CiBoT
                Participants:
                Component watchers:
                Adrian Greeve, Mihail Geshoski, Peter Dias, Adrian Greeve, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  19/Mar/18