Details
Description
The SQL generated when using strings in the THEN and ELSE parts of the CASE expression are not valid.
This testcase will fail:
$this->assertSqlGeneration(
"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:
https://github.com/doctrine/doctrine2/pull/277
https://github.com/doctrine/doctrine2/pull/278
Fixed by https://github.com/doctrine/doctrine2/commit/795438670517cd7a4e76bca6dd33fdc9bbb5d988
@beberlei please merge in 2.2! =D