{"action":"created","issue":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/6730","repository_url":"https://api.github.com/repos/doctrine/doctrine2","labels_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6730/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6730/comments","events_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6730/events","html_url":"https://github.com/doctrine/doctrine2/issues/6730","id":260543384,"number":6730,"title":"Partial query ignores where statement if not in select","user":{"login":"escopecz","id":1235442,"avatar_url":"https://avatars2.githubusercontent.com/u/1235442?v=4","gravatar_id":"","url":"https://api.github.com/users/escopecz","html_url":"https://github.com/escopecz","followers_url":"https://api.github.com/users/escopecz/followers","following_url":"https://api.github.com/users/escopecz/following{/other_user}","gists_url":"https://api.github.com/users/escopecz/gists{/gist_id}","starred_url":"https://api.github.com/users/escopecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escopecz/subscriptions","organizations_url":"https://api.github.com/users/escopecz/orgs","repos_url":"https://api.github.com/users/escopecz/repos","events_url":"https://api.github.com/users/escopecz/events{/privacy}","received_events_url":"https://api.github.com/users/escopecz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-09-26T08:54:21Z","updated_at":"2017-09-26T09:09:23Z","closed_at":"2017-09-26T09:09:23Z","author_association":"NONE","body":"Following query examples are output of `getDql()` method with pasted parameters for easier understanding of the problem.\r\n\r\nThis query does what I'd expect. It returns all company fields:\r\n```\r\nSELECT f FROM Field f INDEX BY f.id WHERE f.object = 'company'\r\n```\r\n\r\nHowever this query returns ALL fields, not only company fields:\r\n```\r\nSELECT f.{id} FROM Field f INDEX BY f.id WHERE f.object = 'company'\r\n```\r\n\r\nIt took me a while to find out what's going on there. If I specifically list the `object` column in the select clause, the where condition will work again and only company fields will be returned:\r\n```\r\nSELECT f.{id,object} FROM Field f INDEX BY f.id WHERE f.object = 'company'\r\n```\r\n\r\nI couldn't find any documentation on this topic nor any reported issue. Why does it work that way? Isn't it a bug?"},"comment":{"url":"https://api.github.com/repos/doctrine/doctrine2/issues/comments/332136258","html_url":"https://github.com/doctrine/doctrine2/issues/6730#issuecomment-332136258","issue_url":"https://api.github.com/repos/doctrine/doctrine2/issues/6730","id":332136258,"user":{"login":"escopecz","id":1235442,"avatar_url":"https://avatars2.githubusercontent.com/u/1235442?v=4","gravatar_id":"","url":"https://api.github.com/users/escopecz","html_url":"https://github.com/escopecz","followers_url":"https://api.github.com/users/escopecz/followers","following_url":"https://api.github.com/users/escopecz/following{/other_user}","gists_url":"https://api.github.com/users/escopecz/gists{/gist_id}","starred_url":"https://api.github.com/users/escopecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/escopecz/subscriptions","organizations_url":"https://api.github.com/users/escopecz/orgs","repos_url":"https://api.github.com/users/escopecz/repos","events_url":"https://api.github.com/users/escopecz/events{/privacy}","received_events_url":"https://api.github.com/users/escopecz/received_events","type":"User","site_admin":false},"created_at":"2017-09-26T09:09:23Z","updated_at":"2017-09-26T09:09:23Z","author_association":"NONE","body":"Ok, I think it's nota doctrine bug. The entities will return the default value if the column isn't fetched from the database. So it is returning `company` fields, but object is `lead` because that's the default value.\r\n\r\n@Ocramius Thanks for helping me realize that!"}}
{"actor":{"display_login":"escopecz"}}