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.

CommentFileSizeAuthor
core_bug.jpg60 KBbvanmeurs
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bvanmeurs’s picture

Issue summary: View changes

.

bvanmeurs’s picture

Status: Active » Closed (duplicate)
bvanmeurs’s picture

Issue summary: View changes

.