Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Deferred
-
2.2.3
-
None
-
None
-
MySQL 5.5
Description
If there are two directories with the same path but in different cases, get_directory_files will return files from both on MySQL. To replicate:
- Create a folder resource
- Add two directories with the same name but in different cases (e.g. "lab_data" and "Lab_Data")
- Add a file to one of them
- Browse to the other
- You should see the file
(I think this may also be the root cause of the issues described in http://moodle.org/mod/forum/discuss.php?d=173393 and reported in MDL-29225.)
This is caused by the fact that MySQL does case-insensitive string comparisons by default (http://dev.mysql.com/doc/refman/5.1/en/case-sensitivity.html). There seem to be two possible fixes for it, neither of which look as if they'd be easy to implement:
- Change the collation of the mdl_files table
- Insert the keyword BINARY into the SQL before the SUBSTR clause