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

MS SQL DB driver casting string to int breaks a query that should work, which breaks qtype_multichoice upgrade

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 2.0
    • 2.0
    • None
    • Windows Server Server 2008, SQL 2005, FreeTDS, IIS 7
    • MySQL
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      Upgrade from 1.9.10 to 2.0 RC1. Upgrade process gets stuck on upgrading qtype_multichoice

      Debug info: Conversion failed when converting the varchar value '<div class="text_to_html">1</d' to data type int.
      UPDATE mdl_question SET name = ? WHERE qtype = 'random' AND category = ? AND CONVERT(varchar, questiontext, 32) = ?
      [array (
      0 => 'Random (Default for 4th Form Biology Resources)',
      1 => '27',
      2 => '0',
      )]
      Stack trace:
      line 394 of \lib\dml\moodle_database.php: dml_write_exception thrown
      line 247 of \lib\dml\mssql_native_moodle_database.php: call to moodle_database->query_end()
      line 1016 of \lib\dml\mssql_native_moodle_database.php: call to mssql_native_moodle_database->query_end()
      line 46 of \question\type\multichoice\db\upgrade.php: call to mssql_native_moodle_database->set_field_select()
      line 358 of \lib\upgradelib.php: call to xmldb_qtype_multichoice_upgrade()
      line 1352 of \lib\upgradelib.php: call to upgrade_plugins()
      line 302 of \admin\index.php: call to upgrade_noncore()

      unable to fix at this time (bypassed to test)

      information:

      The varchar value '<div class="text_to_html">1</d' is the first 32 characters of the database field questiontext. I am unsure why the array being passed is trying to match the question text to '0'

        1. 2010111000-MDL-24863.patch
          3 kB
          Aparup Banerjee
        2. 2010111202-MDL-24863.patch
          5 kB
          Aparup Banerjee
        3. 2010111203-MDL-24863.patch
          5 kB
          Aparup Banerjee
        4. 2010111500-MDL-24863.patch
          15 kB
          Aparup Banerjee
        5. 2010111600-MDL-24863.patch
          17 kB
          Aparup Banerjee
        6. 2010111700-MDL-24863-mssql_emulate_bound_params_tweak.patch
          0.8 kB
          Aparup Banerjee
        7. 2010111700-MDL-24863-prevent-text-to-text-equating.patch
          17 kB
          Aparup Banerjee
        8. MDL-24863_unittest.patch.txt
          1 kB
          Tim Hunt

            nebgor Aparup Banerjee
            kk20 mark williams (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.