Last modified: 2010-05-15 15:42:46 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9722, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7722 - Syntax errors in patch-ipb_anon_only.sql called by update.php
Syntax errors in patch-ipb_anon_only.sql called by update.php
Status: RESOLVED DUPLICATE of bug 7669
Product: MediaWiki
Classification: Unclassified
Installer (Other open bugs)
1.8.x
PC Windows Server 2003
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-10-26 21:29 UTC by Kevin Roberts
Modified: 2010-05-15 15:42 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Kevin Roberts 2006-10-26 21:29:13 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;
Comment 1 Kevin Roberts 2006-10-26 21:31:16 UTC
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."
Comment 2 Rob Church 2006-12-21 20:03:03 UTC

*** This bug has been marked as a duplicate of 7669 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links