Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.4
    • Component/s: DQL
    • Security Level: All
    • Labels:
      None

      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 '=' 
      

        Activity

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Miha Vrhovnik
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: