Issue Details (XML | Word | Printable)

Key: MDL-7994
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Major Major
Assignee: Eloy Lafuente (stronk7)
Reporter: Martin Anderson
Votes: 1
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

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

Created: 21/Dec/06 06:50 AM   Updated: 06/May/07 06:45 PM
Return to search
Component/s: Installation
Affects Version/s: 1.7
Fix Version/s: None

File Attachments: 1. File mysql.php (2 kB)

Environment: Windows Server 2003, Apache 2.2.3, MySQL 5.0.27, PHP 5.2.0
Issue Links:
Duplicate
 
Relates
 

Database: MySQL
Participants: Eloy Lafuente (stronk7), Ken Wilson, Martin Anderson and Samuli Karevaara
Security Level: None
Resolved date: 06/May/07
Affected Branches: MOODLE_17_STABLE


 Description  « Hide
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.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda made changes - 21/Dec/06 07:07 AM
Field Original Value New Value
Assignee Martin Dougiamas [ dougiamas ] Eloy Lafuente (stronk7) [ stronk7 ]
Ken Wilson made changes - 22/Dec/06 06:27 AM
Link This issue has been marked as being related by MDL-7765 [ MDL-7765 ]
Samuli Karevaara made changes - 06/May/07 06:44 PM
Link This issue duplicates MDL-6218 [ MDL-6218 ]
Samuli Karevaara made changes - 06/May/07 06:45 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Duplicate [ 3 ]