Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 1.7
-
Fix Version/s: None
-
Component/s: Installation
-
Labels:None
-
Environment:Windows Server 2003, Apache 2.2.3, MySQL 5.0.27, PHP 5.2.0
-
Database:MySQL
-
Affected Branches:MOODLE_17_STABLE
Description
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.
See also http://moodle.org/mod/forum/discuss.php?d=60755 for user feedback.
http://dev.mysql.com/doc/refman/5.0/en/blob.html also says that text/blob columns cannot have default values. But the error will only be raised when mysql is set to run in scrict mode. See http://bugs.mysql.com/bug.php?id=19498 for the bug report which caused the inconsistency to get fixed.
I wonder how many more of these strict mode adherence problems there are?