Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-5083

Upgrade of qtype_gapfill to 1.4 crash with SQL Server 2008 R2

XMLWordPrintable

    • 1.4
    • MOODLE_24_STABLE

      Here is the error message appearing when trying to upgrade the qtype_gapfill plugin to 1.4 using Moodle admin account:

      Debug info: SQLState: 42000<br>
      Error Code: 156<br>
      Message: [Microsoft][SQL Server Native Client 11.0][SQL Server]Syntaxe incorrecte vers le mot clé 'column'.<br>

      ALTER TABLE mdl_question_gapfill add column disableregex tinyint(1)
      default 0 after noduplicates

      Error code: ddlexecuteerror
      Stack trace:
      line 432 of \lib\dml\moodle_database.php: ddl_change_structure_exception thrown
      line 260 of \lib\dml\sqlsrv_native_moodle_database.php: call to moodle_database->query_end()
      line 707 of \lib\dml\sqlsrv_native_moodle_database.php: call to sqlsrv_native_moodle_database->query_end()
      line 79 of \question\type\gapfill\db\upgrade.php: call to sqlsrv_native_moodle_database->change_database_structure()
      line 473 of \lib\upgradelib.php: call to xmldb_qtype_gapfill_upgrade()
      line 1544 of \lib\upgradelib.php: call to upgrade_plugins()
      line 349 of \admin\index.php: call to upgrade_noncore()

      This SQL query is not compliant with SQL Server. I've spotted two reasons why:

      1) On SQL Server, an ADD COLUMN statement must be wrote without the 'column' key word like this:
      ALTER TABLE mdl_question_gapfill ADD disableregex tinyint(1)
      default 0

      2) SQL Server isn't compliant with 'AFTER' keyword.

            Unassigned Unassigned
            n.mouillet@helmo.be Nicolas Mouillet
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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