Details
Description
Having the following part in select DQL throws an exception.
SUM(CASE
WHEN c.startDate <= :start THEN c.endDate - :start
WHEN c.endDate >= :end THEN :end - c.startDate
ELSE 0
END)
exception:
[Syntax Error] line 0, col 124: Error: Expected Doctrine\ORM\Query\Lexer::T_ELSE, got '-'
It seems that it's failing inside the second THEN
This one also seems to fail:
SUM(CASE
WHEN c.startDate <= :start THEN (c.endDate - :start)
WHEN c.endDate >= :end THEN (:end - c.startDate)
ELSE 0
END)
exception:
[Syntax Error] line 0, col 60: Error: Unexpected '('
Another one:
SUM(CASE
WHEN c.startDate <= :start THEN c.endDate - :start
WHEN c.endDate >= :end THEN :end - c.startDate
ELSE 0
END) = :result FROM ...
exception:
[Syntax Error] line 0, col 60: Error: Expected Doctrine\ORM\Query\Lexer::T_FROM, got '='
I've added two more cases where the parsing fails. Do you want a separate tickets for that?