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

Upgrade Errors: MySQL Error 1101: BLOB/TEXT columns cannot have a DEFAULT value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 1.7
    • Installation
    • None
    • Windows Server 2003, Apache 2.2.3, MySQL 5.0.27, PHP 5.2.0
    • MySQL
    • MOODLE_17_STABLE

      Example error: MySQL error 1101: BLOB/TEXT column 'manualcomment' can't have a default value

      During upgrades from 1.6.1+ to 1.7+ (latest stable release as of 2006/12/20) there were several instances of updating/adding tables in the database which the mysql.php files are using a create_column function for BLOB/TEXT columns that has a setting to include a DEFAULT value. According to MySQL error reference (http://dev.mysql.com/doc/refman/5.0/en/error-messages-server.html) BLOB/TEXT columns cannot have a default value. This causes many errors in the install including causing the installer to loop during the quiz and question upgrades (though the installer continues through earlier updates with this error). The updates that add TEXT/BLOB columns to the database could use the execute_sql function or something similar so that there is not an error when they are run.

      The two mysql.php file locations that caused looping during my test installations
      mod/quiz/db/
      question/type/multichoice/db

      Attached is the mysql.php file from the multichoice database upgrade, which first has the original code and then my modification to eliminate the error during installation.

            stronk7 Eloy Lafuente (stronk7)
            mganderson Martin Anderson
            Nobody Nobody (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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