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

Upgrade fails from 1.9 -> 2.0 -> 2.1 - "Debug info: Unknown column 'questionid' in 'mdl_question_attempts'"

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.1.1
    • Fix Version/s: None
    • Component/s: Installation, Quiz
    • Labels:
      None
    • Affected Branches:
      MOODLE_21_STABLE

      Description

      On fresh installs of Moodle 1.9 the question attempts table is created with two columns, id and modulename, specified in mod/quiz/install.xml. Later on, the Moodle upgrade checks to see if the question_attempts table exists, if it does not, it adds it with other fields. Now coming from a 1.9 upgrade this is going to be ignored as the table exists. This will then cause an error later in the upgrade, the following error occurs. I have created a patch to fix this issue.

      Debug info: Unknown column 'questionid' in 'mdl_question_attempts'
      ALTER TABLE mdl_question_attempts ADD variant BIGINT(10) unsigned NOT NULL DEFAULT 1 AFTER questionid
      Stack trace:
      line 400 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
      line 655 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 88 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
      line 75 of /lib/ddl/database_manager.php: call to database_manager->execute_sql()
      line 586 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()
      line 6492 of /lib/db/upgrade.php: call to database_manager->add_field()
      line 1423 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      line 277 of /admin/index.php: call to upgrade_core()

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: