summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2012-04-22 19:48:48 -0700
committerwebchick2012-04-22 19:48:48 -0700
commit85a421eb9ba59a542d9cc0afeb91fa0e6ff0132c (patch)
treeecdb303afa6226048a7cb4ddd7b6fa5236da5bb1
parent48f271b63ebc400bfe75ca852ed8faf5d9347dc5 (diff)
Issue #966210 by mfb, catch, bfroehle, drewish, drumm, makara, sun, BTMash, iamEAP: Fixed DB Case Sensitivity: system_update_7061() fails on inserting files with same name but different case.
-rw-r--r--core/modules/system/system.install2
-rw-r--r--core/modules/system/tests/file.test13
2 files changed, 15 insertions, 0 deletions
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index e3517d7..51603ff 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -862,6 +862,7 @@ function system_schema() {
'length' => 255,
'not null' => TRUE,
'default' => '',
+ 'binary' => TRUE,
),
'uri' => array(
'description' => 'The URI to access the file (either local or remote).',
@@ -869,6 +870,7 @@ function system_schema() {
'length' => 255,
'not null' => TRUE,
'default' => '',
+ 'binary' => TRUE,
),
'langcode' => array(
'description' => 'The {language}.langcode of this file.',
diff --git a/core/modules/system/tests/file.test b/core/modules/system/tests/file.test
index c5eced1..173d05a 100644
--- a/core/modules/system/tests/file.test
+++ b/core/modules/system/tests/file.test
@@ -2042,6 +2042,19 @@ class FileSaveTest extends FileHookTestCase {
$this->assertNotNull($loaded_file, t("Record still exists in the database."), 'File');
$this->assertEqual($loaded_file->status, $saved_file->status, t("Status was saved correctly."));
$this->assertEqual($loaded_file->langcode, 'en', t("Langcode was saved correctly."));
+
+ // Try to insert a second file with the same name apart from case insensitivity
+ // to ensure the 'uri' index allows for filenames with different cases.
+ $file = (object) array(
+ 'uid' => 1,
+ 'filename' => 'DRUPLICON.txt',
+ 'uri' => 'public://DRUPLICON.txt',
+ 'filemime' => 'text/plain',
+ 'timestamp' => 1,
+ 'status' => FILE_STATUS_PERMANENT,
+ );
+ file_put_contents($file->uri, 'hello world');
+ file_save($file);
}
}