Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.6
    • Fix Version/s: 2.2.8
    • Component/s: Installation
    • Labels:
      None
    • Testing Instructions:
      Hide

      1/ install any 1.9-2.2 moodle version before this patch
      2/ execute upgrade to this patched version
      3/ verify there are no notices or errors

      Show
      1/ install any 1.9-2.2 moodle version before this patch 2/ execute upgrade to this patched version 3/ verify there are no notices or errors
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:

      Description

      I am building an upgrade path from our legacy moodle 1.9 instances to moodle 2.4. My upgrade system works well when I upgrade from 1.9 to 2.2 using the CLI systems, but I get a problem that Google has no answer for when I try to then leap-frog from 2.2 to 2.4.

      Here is the error:
      http://goo.gl/EK1yn

      Debug info: Out of range value for column 'sortorder' at row 106
      ALTER TABLE `mdl_course` MODIFY COLUMN `sortorder` bigint(10) signed NOT NULL DEFAULT '0'
      Error code: ddlexecuteerror
      Stack trace:

      line 432 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
      line 860 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
      line 139 of /lib/db/upgradelib.php: call to mysqli_native_moodle_database->change_database_structure()
      line 232 of /lib/db/upgrade.php: call to upgrade_mysql_fix_unsigned_columns()
      line 1493 of /lib/upgradelib.php: call to xmldb_main_upgrade()
      line 284 of /admin/index.php: call to upgrade_core()

      I don't often post, so please give me feedback as to more information that I can give on the subject. I don't want to brain-dump everything about the instance for fear of getting tl;dr from everyone who could help me, so I want to know what's relevant.

      These are the exact packages I am using.
      http://downloads.sourceforge.net/project/moodle/Moodle/stable22/moodle-latest-22.tgz?r=&ts=1355340759&use_mirror=superb-dca2
      http://downloads.sourceforge.net/project/moodle/Moodle/stable24/moodle-latest-24.tgz?r=&ts=1355355328&use_mirror=superb-dca3

        Gliffy Diagrams

          Activity

          Hide
          Lu Pa added a comment -

          I get similar error upgrading from 2.2.7 to 2.4.1:

          The error:

          -->System
          Default exception handler: DDL sql execution error Debug: Out of range value for column 'sortorder' at row 32
          ALTER TABLE `mdl_course` MODIFY COLUMN `id` bigint(10) signed NOT NULL AUTO_INCREMENT, MODIFY COLUMN `category` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `sortorder` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `summary` LONGTEXT NULL , MODIFY COLUMN `summaryformat` tinyint(2) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `showgrades` tinyint(2) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `newsitems` mediumint(5) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `startdate` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `numsections` mediumint(5) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `marker` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `maxbytes` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `legacyfiles` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `showreports` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `visible` tinyint(1) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `visibleold` tinyint(1) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `hiddensections` tinyint(2) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `groupmode` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `groupmodeforce` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `defaultgroupingid` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `timecreated` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `timemodified` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `requested` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `restrictmodules` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `enablecompletion` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `completionnotify` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `completionstartonenrol` tinyint(1) signed NOT NULL DEFAULT '0'
          Error code: ddlexecuteerror

          • line 432 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
          • line 860 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          • line 161 of /lib/db/upgradelib.php: call to mysqli_native_moodle_database->change_database_structure()
          • line 233 of /lib/db/upgrade.php: call to upgrade_mysql_fix_unsigned_and_lob_columns()
          • line 1493 of /lib/upgradelib.php: call to xmldb_main_upgrade()
          • line 153 of /admin/cli/upgrade.php: call to upgrade_core()

          !!! DDL sql execution error !!!
          !! Out of range value for column 'sortorder' at row 32
          ALTER TABLE `mdl_course` MODIFY COLUMN `id` bigint(10) signed NOT NULL AUTO_INCREMENT, MODIFY COLUMN `category` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `sortorder` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `summary` LONGTEXT NULL , MODIFY COLUMN `summaryformat` tinyint(2) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `showgrades` tinyint(2) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `newsitems` mediumint(5) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `startdate` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `numsections` mediumint(5) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `marker` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `maxbytes` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `legacyfiles` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `showreports` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `visible` tinyint(1) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `visibleold` tinyint(1) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `hiddensections` tinyint(2) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `groupmode` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `groupmodeforce` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `defaultgroupingid` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `timecreated` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `timemodified` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `requested` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `restrictmodules` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `enablecompletion` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `completionnotify` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `completionstartonenrol` tinyint(1) signed NOT NULL DEFAULT '0'
          Error code: ddlexecuteerror !!
          !! Stack trace: * line 432 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown

          • line 860 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          • line 161 of /lib/db/upgradelib.php: call to mysqli_native_moodle_database->change_database_structure()
          • line 233 of /lib/db/upgrade.php: call to upgrade_mysql_fix_unsigned_and_lob_columns()
          • line 1493 of /lib/upgradelib.php: call to xmldb_main_upgrade()
          • line 153 of /admin/cli/upgrade.php: call to upgrade_core()
            !!
          Show
          Lu Pa added a comment - I get similar error upgrading from 2.2.7 to 2.4.1: The error: -->System Default exception handler: DDL sql execution error Debug: Out of range value for column 'sortorder' at row 32 ALTER TABLE `mdl_course` MODIFY COLUMN `id` bigint(10) signed NOT NULL AUTO_INCREMENT, MODIFY COLUMN `category` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `sortorder` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `summary` LONGTEXT NULL , MODIFY COLUMN `summaryformat` tinyint(2) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `showgrades` tinyint(2) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `newsitems` mediumint(5) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `startdate` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `numsections` mediumint(5) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `marker` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `maxbytes` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `legacyfiles` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `showreports` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `visible` tinyint(1) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `visibleold` tinyint(1) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `hiddensections` tinyint(2) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `groupmode` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `groupmodeforce` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `defaultgroupingid` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `timecreated` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `timemodified` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `requested` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `restrictmodules` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `enablecompletion` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `completionnotify` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `completionstartonenrol` tinyint(1) signed NOT NULL DEFAULT '0' Error code: ddlexecuteerror line 432 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown line 860 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 161 of /lib/db/upgradelib.php: call to mysqli_native_moodle_database->change_database_structure() line 233 of /lib/db/upgrade.php: call to upgrade_mysql_fix_unsigned_and_lob_columns() line 1493 of /lib/upgradelib.php: call to xmldb_main_upgrade() line 153 of /admin/cli/upgrade.php: call to upgrade_core() !!! DDL sql execution error !!! !! Out of range value for column 'sortorder' at row 32 ALTER TABLE `mdl_course` MODIFY COLUMN `id` bigint(10) signed NOT NULL AUTO_INCREMENT, MODIFY COLUMN `category` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `sortorder` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `summary` LONGTEXT NULL , MODIFY COLUMN `summaryformat` tinyint(2) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `showgrades` tinyint(2) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `newsitems` mediumint(5) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `startdate` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `numsections` mediumint(5) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `marker` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `maxbytes` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `legacyfiles` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `showreports` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `visible` tinyint(1) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `visibleold` tinyint(1) signed NOT NULL DEFAULT '1' , MODIFY COLUMN `hiddensections` tinyint(2) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `groupmode` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `groupmodeforce` smallint(4) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `defaultgroupingid` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `timecreated` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `timemodified` bigint(10) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `requested` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `restrictmodules` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `enablecompletion` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `completionnotify` tinyint(1) signed NOT NULL DEFAULT '0' , MODIFY COLUMN `completionstartonenrol` tinyint(1) signed NOT NULL DEFAULT '0' Error code: ddlexecuteerror !! !! Stack trace: * line 432 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown line 860 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 161 of /lib/db/upgradelib.php: call to mysqli_native_moodle_database->change_database_structure() line 233 of /lib/db/upgrade.php: call to upgrade_mysql_fix_unsigned_and_lob_columns() line 1493 of /lib/upgradelib.php: call to xmldb_main_upgrade() line 153 of /admin/cli/upgrade.php: call to upgrade_core() !!
          Hide
          Petr Skoda added a comment -

          There was a bug in 1.9 that caused the sortorder to grow very quickly, workaround could be to try to reshuffle the courses in 2.2 a bit before doing the 2.4 ugprade.

          Show
          Petr Skoda added a comment - There was a bug in 1.9 that caused the sortorder to grow very quickly, workaround could be to try to reshuffle the courses in 2.2 a bit before doing the 2.4 ugprade.
          Hide
          Lu Pa added a comment -

          Yes, I know that, but in a upgrade test, I go from 2.2 to 2.3 and then to 2.4 and works well.

          I will try again, but my moodle is too big

          Show
          Lu Pa added a comment - Yes, I know that, but in a upgrade test, I go from 2.2 to 2.3 and then to 2.4 and works well. I will try again, but my moodle is too big
          Hide
          Lu Pa added a comment -

          Jeffrey, Peter:

          I found the problem ! In the upgrading, sortorder problem doesn't fixed, but, when you create the first category in the migrated moodle, sortorder is automatically fixed.

          So the procedure is:
          1. Upgrade from 1.9.x to 2.2.x
          2. Create a test category
          3. Check the database to see if sortorder is wright
          4. Apply the upgrade.

          I'm doing it at this moment. If there is no more news from me, then... it works!

          Show
          Lu Pa added a comment - Jeffrey, Peter: I found the problem ! In the upgrading, sortorder problem doesn't fixed, but, when you create the first category in the migrated moodle, sortorder is automatically fixed. So the procedure is: 1. Upgrade from 1.9.x to 2.2.x 2. Create a test category 3. Check the database to see if sortorder is wright 4. Apply the upgrade. I'm doing it at this moment. If there is no more news from me, then... it works!
          Hide
          Matteo Scaramuccia added a comment -

          Hi Petr,
          is lib/datalib.php::fix_course_sortorder() supposed to fix that sort of issue? On MOODLE_22_STABLE in lib/db/upgrade.php I found no mention of it.

          FYI: I'm learning the Moodle framework from time to time "lurking" at the issues, now looking at MDL-14580, MDL-18897, MDL-25669. I love the Moodle Development Process , besides the adoption of git really improves it to the next level!

          Matteo

          Show
          Matteo Scaramuccia added a comment - Hi Petr, is lib/datalib.php::fix_course_sortorder() supposed to fix that sort of issue? On MOODLE_22_STABLE in lib/db/upgrade.php I found no mention of it. FYI: I'm learning the Moodle framework from time to time "lurking" at the issues, now looking at MDL-14580 , MDL-18897 , MDL-25669 . I love the Moodle Development Process , besides the adoption of git really improves it to the next level! Matteo
          Hide
          Petr Skoda added a comment -

          Matteo: yes, any action that triggers the fixing of sortorder works around this issue.

          To integrators: it is unlikely that more sites will be affected, but the fix is pretty easy...

          Thanks for the report.

          Show
          Petr Skoda added a comment - Matteo: yes, any action that triggers the fixing of sortorder works around this issue. To integrators: it is unlikely that more sites will be affected, but the fix is pretty easy... Thanks for the report.
          Hide
          Sam Hemelryk added a comment -

          Thanks Petr - this simple fix has been integrated now.

          Show
          Sam Hemelryk added a comment - Thanks Petr - this simple fix has been integrated now.
          Hide
          Frédéric Massart added a comment -

          Test passed using an outdated 2.2 to the latest 2.2

          Show
          Frédéric Massart added a comment - Test passed using an outdated 2.2 to the latest 2.2
          Hide
          Eloy Lafuente (stronk7) added a comment -

          A brilliant future is awaiting us out there, better with your code. Let's look towards the future together, this is now closed.

          (and won't be revisiting it unless some regression is found)

          Thanks and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - A brilliant future is awaiting us out there, better with your code. Let's look towards the future together, this is now closed. (and won't be revisiting it unless some regression is found) Thanks and ciao

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: