Last modified: 2010-05-15 15:42:46 UTC
Environment: Windows Server 2003 Web server: Apache 2.2.3 Database: MySQL 5.0.26 Attempting to upgrade 1.7 to 1.8.2 The SQL code in patch-ipb_anon_only.sql which is called by update.php has syntax errors. CREATE TABLE code tries to assign default values to TINYBLOB columns, but this attribute does not apply to TEXT/BLOB columns, and triggers an error (perhaps because I am running MySQL in strict mode). The affected columns are: 1. ipb_address 2. ipb_reason 3. ipb_range_start 4. ipb_range_end *** CURRENT CODE IS... *** CREATE TABLE /*$wgDBprefix*/ipblocks_newunique ( ipb_id int(8) NOT NULL auto_increment, ipb_address tinyblob NOT NULL default '', ipb_user int(8) unsigned NOT NULL default '0', ipb_by int(8) unsigned NOT NULL default '0', ipb_reason tinyblob NOT NULL default '', ipb_timestamp char(14) binary NOT NULL default '', ipb_auto bool NOT NULL default 0, ipb_anon_only bool NOT NULL default 0, ipb_create_account bool NOT NULL default 1, ipb_expiry char(14) binary NOT NULL default '', ipb_range_start tinyblob NOT NULL default '', ipb_range_end tinyblob NOT NULL default '', PRIMARY KEY ipb_id (ipb_id), UNIQUE INDEX ipb_address_unique (ipb_address(255), ipb_user, ipb_auto), INDEX ipb_user (ipb_user), INDEX ipb_range (ipb_range_start(8), ipb_range_end(8)), INDEX ipb_timestamp (ipb_timestamp), INDEX ipb_expiry (ipb_expiry) ) TYPE=InnoDB; ** ...BUT SHOULD BE: *** CREATE TABLE /*$wgDBprefix*/ipblocks_newunique ( ipb_id int(8) NOT NULL auto_increment, ipb_address tinyblob NOT NULL, ipb_user int(8) unsigned NOT NULL default '0', ipb_by int(8) unsigned NOT NULL default '0', ipb_reason tinyblob NOT NULL, ipb_timestamp char(14) binary NOT NULL default '', ipb_auto bool NOT NULL default 0, ipb_anon_only bool NOT NULL default 0, ipb_create_account bool NOT NULL default 1, ipb_expiry char(14) binary NOT NULL default '', ipb_range_start tinyblob NOT NULL, ipb_range_end tinyblob NOT NULL, PRIMARY KEY ipb_id (ipb_id), UNIQUE INDEX ipb_address_unique (ipb_address(255), ipb_user, ipb_auto), INDEX ipb_user (ipb_user), INDEX ipb_range (ipb_range_start(8), ipb_range_end(8)), INDEX ipb_timestamp (ipb_timestamp), INDEX ipb_expiry (ipb_expiry) ) TYPE=InnoDB;
MySQL 5.0 manual (http://dev.mysql.com/doc/refman/5.0/en/create-table.html) says: "...Some attributes do not apply to all data types. AUTO_INCREMENT applies only to integer types. DEFAULT does not apply to the BLOB or TEXT types."
*** This bug has been marked as a duplicate of 7669 ***