{"action":"opened","issue":{"url":"https://api.github.com/repos/doctrine/orm/issues/7605","repository_url":"https://api.github.com/repos/doctrine/orm","labels_url":"https://api.github.com/repos/doctrine/orm/issues/7605/labels{/name}","comments_url":"https://api.github.com/repos/doctrine/orm/issues/7605/comments","events_url":"https://api.github.com/repos/doctrine/orm/issues/7605/events","html_url":"https://github.com/doctrine/orm/issues/7605","id":408812312,"node_id":"MDU6SXNzdWU0MDg4MTIzMTI=","number":7605,"title":"Condition using \"CASE WHEN\" not expecting \"IN\" keyword","user":{"login":"Tony-Esales","id":24778993,"node_id":"MDQ6VXNlcjI0Nzc4OTkz","avatar_url":"https://avatars3.githubusercontent.com/u/24778993?v=4","gravatar_id":"","url":"https://api.github.com/users/Tony-Esales","html_url":"https://github.com/Tony-Esales","followers_url":"https://api.github.com/users/Tony-Esales/followers","following_url":"https://api.github.com/users/Tony-Esales/following{/other_user}","gists_url":"https://api.github.com/users/Tony-Esales/gists{/gist_id}","starred_url":"https://api.github.com/users/Tony-Esales/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tony-Esales/subscriptions","organizations_url":"https://api.github.com/users/Tony-Esales/orgs","repos_url":"https://api.github.com/users/Tony-Esales/repos","events_url":"https://api.github.com/users/Tony-Esales/events{/privacy}","received_events_url":"https://api.github.com/users/Tony-Esales/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-02-11T14:39:15Z","updated_at":"2019-02-11T14:39:15Z","closed_at":null,"author_association":"NONE","body":"### Bug Report\r\n\r\nDQL:\r\nSELECT cg FROM \\App\\Entity\\Common\\CompanyGroup cg WHERE CASE WHEN cg.id = 1 THEN 0 WHEN cg.id = 2 THEN 1 ELSE 3 END IN (3)\r\nError:\r\n[Syntax Error] line 0, col 116: Error: Expected =, <, <=, <>, >, >=, !=, got 'IN'\r\n\r\nIf I change \"IN (3)\" for \"= 3\" it works.\r\n\r\nNote: the DQL above is not my real need, it's just a simple snippet of code to demonstrate the bug. The entity used can have just one field called \"id\" to run the example.\r\n\r\nBC Break: no (I guess)\r\nVersion: doctrine/orm 2.6.3\r\n\r\n#### Summary\r\nDoctrine should accept \"IN\" operator when the left operand IS a \"CASE WHEN\" (DQL)\r\n\r\n#### Current behavior\r\nDoctrine is not accepting \"IN\" when the left operand IS a \"CASE WHEN\"\r\n\r\n#### How to reproduce\r\n\r\n$q = $em->createQuery('SELECT cg FROM \\App\\Entity\\Common\\CompanyGroup cg WHERE CASE WHEN cg.id = 1 THEN 0 WHEN cg.id = 2 THEN 1 ELSE 3 END IN (3)');\r\n$cgs = $q->getResult();\r\n\r\n#### Expected behavior\r\nThe DQL above run without any error\r\n"}}
{"actor":{"display_login":"Tony-Esales"}}