I have upgraded from 5.13 to 6.7 today and got this error:

user warning: Duplicate entry '3896-0' for key 1 query: ALTER TABLE locales_target ADD PRIMARY KEY (language, lid, plural) in .../html/includes/database.mysql-common.inc on line 374.

I think this is the system_update_6043 that fails and now the schema is inconsistent:

  // Alter locale table to add a primary key, drop an index.
  if (db_table_exists('locales_target')) {
    db_add_primary_key($ret, 'locales_target', array('language', 'lid', 'plural'));
  }

Comments

ryosaeba’s picture

I've the same problem

This is my error:

user warning: Duplicate entry '636-0' for key 1 query: ALTER TABLE locales_target ADD PRIMARY KEY (language, lid, plural) in /Applications/MAMP/htdocs/walterfantauzzi/includes/database.mysql-common.inc on line 374.

What I must do for resolve it?

hass’s picture

Remove the duplicate entry and manually add the primary key... :-(

TheRec’s picture

strellman’s picture

Version: 6.7 » 6.13

Still happening on d6.13
I don't know SQL syntax so manually add it was too vague for me.
If your warning is:
Duplicate entry '1-0' for key 1 query: ALTER TABLE locales_target ADD PRIMARY KEY
Then go to phpmyadmin find your database, look at the table structure, in the SQL tab type:
ALTER TABLE locales_target ADD PRIMARY KEY (language, lid, plural)

See also same issue at http://drupal.org/node/223077#comment-1703798

catch’s picture