Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-34086 META: Increase robustness of upgrade from 1.9 to 2.2
  3. MDL-33652

mdl_resource upgrade bug: Data too long for column 'mainfile'

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.2.8
    • 2.2.3
    • Resource
    • MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • Hide
      1. Create a Moodle 1.9 site and ensure debugging is turned on.
      2. Visit a course and choose to add a file resource.
      3. Create a file that has a file name with the length of 255 characters (including the extension).
      4. Upgrade to 2.2 and ensure the resource module upgrades successfully.
      5. Browse to the course and click to view it.
      Show
      Create a Moodle 1.9 site and ensure debugging is turned on. Visit a course and choose to add a file resource. Create a file that has a file name with the length of 255 characters (including the extension). Upgrade to 2.2 and ensure the resource module upgrades successfully. Browse to the course and click to view it.

      This has been previously reported in MDL-32851 and incorrectly marked as "not a bug". The issue is quite simple:
      during upgrade of resources, the value from mdl_resource_old.reference is copied into mdl_resource.mainfile but with additional character - "/" (slash) at the beginning. Both fields are varchar(255) so if mdl_resource_old.reference has length of 255, the total length of the string for mdl_resource.mainfile will be 256 - hence the error.
      During an upgrade to the latest version the field mdl_resource.mainfile is dropped - so you won't see it in that table once upgrade is successfully finished.

            markn Mark Nelson
            tmuras Tomasz Muras
            Petr Skoda Petr Skoda
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Frédéric Massart Frédéric Massart
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

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