Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-33655

MySQL case insensitivity breaks get_directory_files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Deferred
    • Icon: Minor Minor
    • None
    • 2.2.3
    • Files API
    • None
    • MySQL 5.5

      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

            maherne Michael Aherne
            maherne Michael Aherne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.