{"action":"closed","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/14132","labels_url":"https://api.github.com/repos/owncloud/core/issues/14132/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/14132/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/14132/events","html_url":"https://github.com/owncloud/core/issues/14132","id":57407444,"number":14132,"title":"repairmimetypes is not compatible with SQL backends which are case sensitive","user":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/31","html_url":"https://github.com/owncloud/core/milestones/8.1-current","labels_url":"https://api.github.com/repos/owncloud/core/milestones/31/labels","id":912160,"number":31,"title":"8.1-current","description":"","creator":{"login":"MorrisJobke","id":245432,"avatar_url":"https://avatars.githubusercontent.com/u/245432?v=3","gravatar_id":"","url":"https://api.github.com/users/MorrisJobke","html_url":"https://github.com/MorrisJobke","followers_url":"https://api.github.com/users/MorrisJobke/followers","following_url":"https://api.github.com/users/MorrisJobke/following{/other_user}","gists_url":"https://api.github.com/users/MorrisJobke/gists{/gist_id}","starred_url":"https://api.github.com/users/MorrisJobke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MorrisJobke/subscriptions","organizations_url":"https://api.github.com/users/MorrisJobke/orgs","repos_url":"https://api.github.com/users/MorrisJobke/repos","events_url":"https://api.github.com/users/MorrisJobke/events{/privacy}","received_events_url":"https://api.github.com/users/MorrisJobke/received_events","type":"User","site_admin":false},"open_issues":280,"closed_issues":418,"state":"open","created_at":"2014-12-22T12:04:01Z","updated_at":"2015-03-19T16:22:53Z","due_on":"2015-04-02T22:00:00Z","closed_at":null},"comments":3,"created_at":"2015-02-12T02:06:27Z","updated_at":"2015-03-19T16:22:53Z","closed_at":"2015-03-19T16:22:53Z","body":"ownCloud uses the `utf8_bin` binary collation with MySQL. It is a case sensitive collation.\r\n\r\nIf you have a file named DC001.DNG and want to update the media type from `application/octet-stream` to `image/x-dcraw` via the repairmimetypes class, it won't happen because the SQL query will only find files with a `.dng` extension, in lower case.\r\n\r\nThis case sensitivity problem may affect other parts of ownCloud. I only looked at this class.\r\n\r\nOne solution for this specific class is to change this\r\n```\r\nreturn \\OC_DB::prepare('\r\n\tUPDATE `*PREFIX*filecache`\r\n\tSET `mimetype` = (\r\n\t\tSELECT `id`\r\n\t\tFROM `*PREFIX*mimetypes`\r\n\t\tWHERE `mimetype` = ?\r\n\t) WHERE `name` LIKE ?\r\n');\r\n```\r\nto this\r\n```\r\nreturn \\OC_DB::prepare('\r\n\tUPDATE `*PREFIX*filecache`\r\n\tSET `mimetype` = (\r\n\t\tSELECT `id`\r\n\t\tFROM `*PREFIX*mimetypes`\r\n\t\tWHERE `mimetype` = ?\r\n\t) WHERE LOWER(`name`) LIKE ?\r\n');\r\n```"}}