Ticket #281 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

Upgrade script fails on maia_mail_recipients table with "already exists" error

Reported by: rjl Owned by: rjl
Priority: normal Milestone: 1.0.1
Component: PHP scripts Version: 1.0.0
Severity: normal Keywords: upgrade 4.php token token_system_idx
Cc:

Description

A number of people have reported receiving the following error during the upgrade process (from RC5 to 1.0.0):

DB Error: already exists = [ALTER TABLE maia_mail_recipients ADD CONSTRAINT UNIQUE token_system_idx ( token )]

It appears that the algorithm being used to generate the initial set of tokens during the upgrade process is producing some duplicates, rather than the unique values it's supposed to generate.

Change History

Changed 6 years ago by rjl

  • status changed from new to closed
  • resolution set to fixed

Fixed in 957.

Changed 6 years ago by dmorton

  • status changed from closed to reopened
  • resolution fixed deleted

I tested this on a upgrade, and I still got the already exists error.

I am beginning to think it is an error with mysql and transactions. Maybe we can commit the transaction before the last sql satement in 4.php...

Changed 6 years ago by dmorton

A test on the basic mysql client yielded:

mysql> UPDATE maia_mail_recipients set token = MD5(CONCAT(mail_id,'-',recipient_id,'-',RAND())) where token = '';
Query OK, 0 rows affected (0.27 sec)
Rows matched: 0  Changed: 0  Warnings: 0

mysql> ALTER TABLE maia_mail_recipients CHANGE token token CHAR( 32 ) NOT NULL;
Query OK, 186896 rows affected (8.71 sec)
Records: 186896  Duplicates: 0  Warnings: 186896 

which led me to discover that we are testing for when the column is NULL.

Really, we don't need a WHERE clause at all... so [959] and [960] address this.

Changed 6 years ago by rjl

  • status changed from reopened to closed
  • resolution set to fixed

Appears to be fixed in 959 and 960.

Note: See TracTickets for help on using tickets.