Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
To reproduce:
- Create two files on your desktop 'tree.jpg' and 'Tree.jpg' in separate folders.
- On a Linux installation (or another case-sensitive file system) of Drupal, open a (new) node that has a field of type 'file'
- Add the file 'tree.jpg' (don't save yet)
- Then add the file 'Tree.jpg'
- Now you get the following error:
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'public://Bomen.jpg' for key 2: INSERT INTO {file_managed} (uid, filename, uri, filemime, filesize, status, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => Bomen.jpg [:db_insert_placeholder_2] => public://Bomen.jpg [:db_insert_placeholder_3] => image/jpeg [:db_insert_placeholder_4] => 770042 [:db_insert_placeholder_5] => 0 [:db_insert_placeholder_6] => 1331298860 )
(notice I used the files bomen.jpg and Bomen.jpg, the Dutch translation of trees ;-))
The error is obviously due to the fact that the column file_managed.uri is case insensitive (collation utf_general_ci) whereas it should have a case sensitive collation.
Solution: change the column to utf8_bin. This collation is case sensitive.
Comment | File | Size | Author |
---|---|---|---|
core_bug.jpg | 60 KB | bvanmeurs |
Comments
Comment #0.0
bvanmeurs CreditAttribution: bvanmeurs commented.
Comment #1
bvanmeurs CreditAttribution: bvanmeurs commentedSee http://drupal.org/node/966210
Comment #1.0
bvanmeurs CreditAttribution: bvanmeurs commented.