Description:

Error when loading store.mysql database scheme:

SQL-query:

-- --------------------------------------------------------
--
-- Table structure for table `ec_transaction_product`
--
CREATE TABLE ec_transaction_product(
txnid int( 10 ) unsigned NOT NULL default '0',
nid int( 10 ) unsigned NOT NULL default '0',
title varchar( 128 ) default NULL ,
price decimal( 10, 2 ) NOT NULL default '0.00',
qty int( 10 ) unsigned NOT NULL default '0',
expires int( 11 ) unsigned NOT NULL default '0',
product_data text,
is_recurring tinyint( 3 ) unsigned NOT NULL default '0',
price_interval tinyint( 3 ) unsigned NOT NULL default '0',
price_unit varchar( 5 ) NOT NULL default '',
price_cycle int( 11 ) NOT NULL default '0',
auto_charge tinyint( 3 ) unsigned NOT NULL default '0',
last_notify int( 11 ) unsigned NOT NULL default '0',
UNIQUE KEY txnid( txnid, nid ) ,
KEY txnid( txnid )
) TYPE = MYISAM

MySQL said: #1061 - Duplicate key name 'txnid' 

Comments

ezheidtmann’s picture

Also affecting me on Mysql server version 4.0.24_Debian-5-log.

Jesse Grosjean’s picture

I see this too and am using MySQL 4.1.9-log. Does anyone know what needs to be changed to fix the problem?

Jesse

hunmonk’s picture

the problem is right here:

UNIQUE KEY txnid (txnid,nid),
KEY txnid (txnid)

an individual table definition can't have two indexes with the same name, and both of the above indexes are named txnid--so one of those is going to need to be changed. i don't know much about drupal naming conventions yet, so i can't really advise how to change it officially. for me, i'm just running a test site on my local machine, and i've got nothing to lose--so this edit worked fine for me:

UNIQUE KEY txnid (txnid,nid),
KEY txnid2 (txnid)

if you're doing anything important, you might want to wait for an official fix, though... :)

chad

hunmonk’s picture

the problem is right here:

UNIQUE KEY txnid (txnid,nid),
KEY txnid (txnid)

an individual table definition can't have two indexes with the same name, and both of the above indexes are named txnid--so one of those is going to need to be changed. i don't know much about drupal naming conventions yet, so i can't really advise how to change it officially. for me, i'm just running a test site on my local machine, and i've got nothing to lose--so this edit worked fine for me:

UNIQUE KEY txnid (txnid,nid),
KEY txnid2 (txnid)

if you're doing anything important, you might want to wait for an official fix, though... :)

chad

matt westgate’s picture

This has been fixed. Thanks.

Anonymous’s picture