The query run on module installation fails hard if there are any duplicate entries in {users}.mail (as we discovered the frustrating way while preparing this for use on d.o). That shouldn't happen, but uniqueness isn't enforced in the table schema, so it can. The attached patch updates the query to simply ignore duplicate entries using some idempotent ON DUPLICATE KEY UPDATE logic (which, I understand, is better than using IGNORE as it masks some problems).

Comments

sdboyer’s picture

StatusFileSize
new295 bytes

Yeah...attached the wrong patch. lol.

shawn dearmond’s picture

Status: Active » Fixed
hefox’s picture

Status: Fixed » Active

http://drupal.org/node/770068

On duplicate key update is mysql specific, not sure the solution for this issue though.

hefox’s picture

Ignore is also out (http://drupal.org/node/561978)

INSERT INTO multiple_email (uid, email, time_registered, confirmed) SELECT uid, mail, created, 1 FROM users WHERE uid != 0 AND mail != '' GROUP BY mail;

This seems to work, anyone see an issue?
I don't have an updated version of the code to patch against, will later assuming I don't forget.

cor3huis’s picture

Bumped, so @hefox you don't forget ;)

hefox’s picture

StatusFileSize
new334 bytes

I forgot u.u

Here's the patch against a drush dl of dev version, untested.

It really should be tested against postgres! (I don't have a set up to test postgres).

shawn dearmond’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.