[DDC-1696] String support in THEN and ELSE part of CASE expression is broken Created: 11/Mar/12  Updated: 12/Mar/12  Resolved: 12/Mar/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: DQL
Affects Version/s: 2.2
Fix Version/s: 2.3
Security Level: All

Type: Bug Priority: Major
Reporter: Alexander Assignee: Guilherme Blanco
Resolution: Fixed Votes: 0
Labels: None


The SQL generated when using strings in the THEN and ELSE parts of the CASE expression are not valid.

This testcase will fail:
"SELECT g.id, CASE WHEN ((g.id / 2) > 18) THEN 'Foo' ELSE 'Bar' END AS test FROM Doctrine\Tests\Models\CMS\CmsGroup g",
"SELECT c0_.id AS id0, CASE WHEN (c0_.id / 2 > 18) THEN 'Foo' ELSE 'Bar' END AS sclr1 FROM cms_groups c0_"

Noticed by a user at github:

Comment by Guilherme Blanco [ 12/Mar/12 ]

Fixed by https://github.com/doctrine/doctrine2/commit/795438670517cd7a4e76bca6dd33fdc9bbb5d988

@beberlei please merge in 2.2! =D

Generated at Thu Oct 08 21:39:41 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.