Author: kevin_roberts
Description:
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:
- ipb_address
- ipb_reason
- ipb_range_start
- 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;
Version: 1.8.x
Severity: normal
OS: Windows Server 2003
Platform: PC