View Issue Details

IDProjectCategoryView StatusLast Update
0000373XMB1Bugspublic2010-12-23 02:02
Reportermiqrogroove Assigned Tomiqrogroove  
PrioritynormalSeveritycrashReproducibilitysometimes
Status closedResolutionfixed 
Target Version1.9.11.10Fixed in Version1.9.11.10 
Summary0000373: Legacy Upgrader Incompatible With MySQL 5.1.8+
DescriptionWhile attempting to upgrade a mature board from version 1.9.8 SP3 to 1.9.11, the upgrader produces the following output when in DEBUG mode:

Changing table schemas to 1.9.11.
MySQL encountered the following error: Multiple primary key defined(errno = 1068)

In the following query: ALTER TABLE `xmb_attachments` ADD PRIMARY KEY (`aid`), ADD INDEX `parentid` (`parentid`), ADD INDEX `uid` (`uid`);
Additional Informationhttp://forums.xmbforum.com/viewthread.php?tid=775627
http://forums.xmbforum.com/viewthread.php?tid=775197
http://bugs.mysql.com/bug.php?id=13883

Raw table structure:

CREATE TABLE `xmb_attachments` (
 `aid` int(10) NOT NULL AUTO_INCREMENT,
 `tid` int(10) NOT NULL DEFAULT '0',
 `pid` int(10) NOT NULL DEFAULT '0',
 `filename` varchar(120) NOT NULL DEFAULT '',
 `filetype` varchar(120) NOT NULL DEFAULT '',
 `filesize` varchar(120) NOT NULL DEFAULT '',
 `attachment` longblob NOT NULL,
 `downloads` int(10) NOT NULL DEFAULT '0',
 PRIMARY KEY (`aid`),
 KEY `tid` (`tid`),
 KEY `pid` (`pid`)
) ENGINE=MyISAM AUTO_INCREMENT=96 DEFAULT CHARSET=latin1


Raw input to createQueryFromDiff:

[09-Apr-2010 19:44:45] array (
  'indices' =>
  array (
    'add' =>
    array (
      0 => 'aid',
      1 => 'parentid',
      2 => 'uid',
    ),
    'drop' =>
    array (
      0 => '',
      1 => 'tid',
    ),
  ),
  'cols' =>
  array (
    'drop' =>
    array (
      0 => 'tid',
    ),
    'add' =>
    array (
      0 => 'img_size',
      1 => 'parentid',
      2 => 'subdir',
      3 => 'uid',
      4 => 'updatetime',
    ),
    'alter' =>
    array (
      0 => 'aid',
    ),
  ),
)


Raw output from createQueryFromDiff:

[09-Apr-2010 19:44:45] array (
  0 => 'ALTER TABLE `xmb_attachments` DROP INDEX `tid`',
  1 => 'ALTER TABLE `xmb_attachments` ADD COLUMN `img_size` varchar(9) NOT NULL AFTER `downloads`, ADD COLUMN `parentid` int(11) NOT NULL default \'0\' AFTER `img_size`, ADD COLUMN `subdir` varchar(15) NOT NULL AFTER `parentid`, ADD COLUMN `uid` int(11) NOT NULL default \'0\' AFTER `subdir`, ADD COLUMN `updatetime` timestamp NOT NULL default CURRENT_TIMESTAMP AFTER `uid`',
  2 => 'ALTER TABLE `xmb_attachments` MODIFY `aid` int(10) NOT NULL auto_increment',
  3 => 'ALTER TABLE `xmb_attachments` DROP COLUMN `tid`',
  4 => 'ALTER TABLE `xmb_attachments` ADD PRIMARY KEY (`aid`), ADD INDEX `parentid` (`parentid`), ADD INDEX `uid` (`uid`)',
)
TagsNo tags attached.
MySQL Version5.1
PHP Version
Web Server
Browser
Flags
Original ReporterSerendipity
SVN Revision2353
Git Commit

Relationships

related to 0000417 closedmiqrogroove Get Rid of the Legacy Upgrader 

Activities

miqrogroove

2010-04-09 16:06

administrator   ~0000238

Last edited: 2010-04-09 16:06

MySQL output has changed from

"PRIMARY KEY  (`aid`),"


to

"PRIMARY KEY (`aid`),"


It looks like there might also be a couple of missing ksort() calls in the upgrader.

miqrogroove

2010-04-09 16:14

administrator   ~0000239

Tested, broken on 5.1.30 and 5.1.45. Tested, works on 5.0.51.

Issue History

Date Modified Username Field Change
2010-04-09 14:57 miqrogroove New Issue
2010-04-09 14:57 miqrogroove Original Reporter => Serendipity
2010-04-09 16:06 miqrogroove Note Added: 0000238
2010-04-09 16:06 miqrogroove Note Edited: 0000238
2010-04-09 16:07 miqrogroove Status new => assigned
2010-04-09 16:07 miqrogroove Assigned To => miqrogroove
2010-04-09 16:14 miqrogroove MySQL Version => 5.1
2010-04-09 16:14 miqrogroove Note Added: 0000239
2010-04-09 16:18 miqrogroove Summary Reproducible Fatal Error in Legacy Upgrader => Legacy Upgrader Incompatible With MySQL 5.1.8+
2010-04-09 16:18 miqrogroove Additional Information Updated
2010-04-09 17:16 miqrogroove SVN Revision => 2353
2010-04-09 17:16 miqrogroove Status assigned => resolved
2010-04-09 17:16 miqrogroove Fixed in Version => 1.9.11.10
2010-04-09 17:16 miqrogroove Resolution open => fixed
2010-04-09 18:22 miqrogroove Additional Information Updated
2010-12-11 16:38 miqrogroove Status resolved => assigned
2010-12-11 16:39 miqrogroove Status assigned => resolved
2010-12-23 02:02 miqrogroove Status resolved => closed
2011-01-15 04:48 miqrogroove Relationship added related to 0000417