{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4758","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4758/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4758/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4758/events","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/4758","id":115992360,"number":4758,"title":"excludeMany doesn't work if there are no values on MariaDB","user":{"login":"kiwinewt","id":29177,"avatar_url":"https://avatars.githubusercontent.com/u/29177?v=3","gravatar_id":"","url":"https://api.github.com/users/kiwinewt","html_url":"https://github.com/kiwinewt","followers_url":"https://api.github.com/users/kiwinewt/followers","following_url":"https://api.github.com/users/kiwinewt/following{/other_user}","gists_url":"https://api.github.com/users/kiwinewt/gists{/gist_id}","starred_url":"https://api.github.com/users/kiwinewt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiwinewt/subscriptions","organizations_url":"https://api.github.com/users/kiwinewt/orgs","repos_url":"https://api.github.com/users/kiwinewt/repos","events_url":"https://api.github.com/users/kiwinewt/events{/privacy}","received_events_url":"https://api.github.com/users/kiwinewt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-11-09T23:37:09Z","updated_at":"2015-11-10T01:11:26Z","closed_at":null,"body":"Example error:\r\n```\r\nSELECT DISTINCT count(DISTINCT \"SiteTree\".\"ID\") AS \"Count\"\r\n\r\nFROM \"SiteTree\"\r\n\r\nWHERE (\"SiteTree\".\"ParentID\" = ?)\r\n AND ((\"SiteTree\".\"ID\" != ?))\r\n AND ((\"SiteTree\".\"ClassName\" NOT IN ()))\r\n\r\nYou have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')))' at line 5 (http://mysite/admin/pages/listview)\r\n```\r\n\r\nThis is easily fixable in framework/search/filters/ExactMatchFilter.php, the excludeMany function (line 104?) by going from:\r\n```\r\nif ($caseSensitive === null) {\r\n        //more code here\r\n} else {\r\n        //more code here\r\n}\r\n```\r\nto\r\n```\r\nif(!empty($values)) {\r\n    if ($caseSensitive === null) {\r\n        //more code here\r\n    } else {\r\n        //more code here\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments/155251124","html_url":"https://github.com/silverstripe/silverstripe-framework/issues/4758#issuecomment-155251124","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/4758","id":155251124,"user":{"login":"kiwinewt","id":29177,"avatar_url":"https://avatars.githubusercontent.com/u/29177?v=3","gravatar_id":"","url":"https://api.github.com/users/kiwinewt","html_url":"https://github.com/kiwinewt","followers_url":"https://api.github.com/users/kiwinewt/followers","following_url":"https://api.github.com/users/kiwinewt/following{/other_user}","gists_url":"https://api.github.com/users/kiwinewt/gists{/gist_id}","starred_url":"https://api.github.com/users/kiwinewt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiwinewt/subscriptions","organizations_url":"https://api.github.com/users/kiwinewt/orgs","repos_url":"https://api.github.com/users/kiwinewt/repos","events_url":"https://api.github.com/users/kiwinewt/events{/privacy}","received_events_url":"https://api.github.com/users/kiwinewt/received_events","type":"User","site_admin":false},"created_at":"2015-11-10T01:11:26Z","updated_at":"2015-11-10T01:11:26Z","body":"According to https://github.com/silverstripe/silverstripe-framework/blame/3.2/search/filters/ExactMatchFilter.php this has been the case since 2013? If so wouldn't changing it cause more issue now?"}}