CVS version :
http://cvs.drupal.org/viewcvs/drupal/drupal/database/database.mysql?r1=1...

The above change makes it impossible to change themes as it creates duplicate entries in the database so the insert fails.
My suggestion to fix this is:

1. Add a one column primary key, as opposed to the composite one you use now.

2. Or, add a third column to the primary key. This should logically be 'theme' but its length is 255, so if you run under MySQL 4.1 with utf-8 encoding, the key will be too long. So you'd have to limit the length of the index like this for example:

ALTER TABLE `blocks` DROP PRIMARY KEY ,
ADD PRIMARY KEY ( `module` , `delta` , `theme` ( 32 ) ) 

HTH.

Comments

mansion’s picture

Status: Active » Fixed

I am closing it myself, it has been fixed (although the fix just reverted to a less optimized version of the sql but the table is not queried that much so that's not big deal).

http://cvs.drupal.org/viewcvs/drupal/drupal/database/database.mysql?r1=1...

Anonymous’s picture

Status: Fixed » Closed (fixed)