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

Upgrade process fails during update of table _role_assignments



    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Database SQL/XMLDB
    • Environment:
      SLES 10.3 SP3, PHP 5.2.14, MySQL 5.0.26


      When upgrading from Moodle 1.9.8+ to Moodle 2.0 (Build: 20101130) the upgrade process fails when upgrading the table _role_assignments.
      The error message "Debug info: Column was set to data type implicit default; NULL supplied for NOT NULL column 'itemid' at row 3" is returned with the failed query

      "UPDATE mdl_role_assignments
      SET itemid = (SELECT MIN(mdl_enrol.id)
      FROM mdl_enrol
      JOIN mdl_context ON (mdl_context.contextlevel = 50 AND mdl_context.instanceid = mdl_enrol.courseid)
      WHERE mdl_role_assignments.component = CONCAT('enrol_', mdl_enrol.enrol) AND mdl_context.id = mdl_role_assignments.contextid)
      WHERE component <> 'enrol_manual' AND component LIKE 'enrol_%'"

      and additional info...

      [array (
      Stack trace:

      • line 394 of /lib/dml/moodle_database.php: dml_write_exception thrown
      • line 672 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      • line 4419 of /lib/db/upgrade.php: call to mysqli_native_moodle_database->execute()
      • line 1309 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      • line 252 of /admin/index.php: call to upgrade_core()

      I am able to manually run the above query on the MySql database which runs without an error. If I then continue the install process after this stage (2010061900.23) then the upgrade completes with no further errors.

      This information is also in the post at http://moodle.org/mod/forum/discuss.php?d=163300




            • Votes:
              0 Vote for this issue
              2 Start watching this issue


              • Created: