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

        Miha Vrhovnik created issue -
        Fabio B. Silva made changes -
        Field Original Value New Value
        Assignee Benjamin Eberlei [ beberlei ] Fabio B. Silva [ fabio.bat.silva ]
        Miha Vrhovnik made changes -
        Description Having the following part in select DQL throws an exception.

        {code:sql}
        SUM(CASE
                    WHEN c.startDate <= :start THEN c.endDate - :start
                    WHEN c.endDate >= :end THEN :end - c.startDate
                    ELSE 0
                    END)
        {code}

        exception:
        {code}
        [Syntax Error] line 0, col 124: Error: Expected Doctrine\ORM\Query\Lexer::T_ELSE, got '-'
        {code}
        It seems that it's failing inside the second THEN
        Having the following part in select DQL throws an exception.

        {code:sql}
        SUM(CASE
                    WHEN c.startDate <= :start THEN c.endDate - :start
                    WHEN c.endDate >= :end THEN :end - c.startDate
                    ELSE 0
                    END)
        {code}

        exception:
        {code}
        [Syntax Error] line 0, col 124: Error: Expected Doctrine\ORM\Query\Lexer::T_ELSE, got '-'
        {code}
        It seems that it's failing inside the second THEN

        This one also seems to fail:
        {code:sql}
        SUM(CASE
                    WHEN c.startDate <= :start THEN (c.endDate - :start)
                    WHEN c.endDate >= :end THEN (:end - c.startDate)
                    ELSE 0
                    END)
        {code}

        exception:
        {code}
        [Syntax Error] line 0, col 60: Error: Unexpected '('
        {code}
        Miha Vrhovnik made changes -
        Description Having the following part in select DQL throws an exception.

        {code:sql}
        SUM(CASE
                    WHEN c.startDate <= :start THEN c.endDate - :start
                    WHEN c.endDate >= :end THEN :end - c.startDate
                    ELSE 0
                    END)
        {code}

        exception:
        {code}
        [Syntax Error] line 0, col 124: Error: Expected Doctrine\ORM\Query\Lexer::T_ELSE, got '-'
        {code}
        It seems that it's failing inside the second THEN

        This one also seems to fail:
        {code:sql}
        SUM(CASE
                    WHEN c.startDate <= :start THEN (c.endDate - :start)
                    WHEN c.endDate >= :end THEN (:end - c.startDate)
                    ELSE 0
                    END)
        {code}

        exception:
        {code}
        [Syntax Error] line 0, col 60: Error: Unexpected '('
        {code}
        Having the following part in select DQL throws an exception.

        {code:sql}
        SUM(CASE
                    WHEN c.startDate <= :start THEN c.endDate - :start
                    WHEN c.endDate >= :end THEN :end - c.startDate
                    ELSE 0
                    END)
        {code}

        exception:
        {code}
        [Syntax Error] line 0, col 124: Error: Expected Doctrine\ORM\Query\Lexer::T_ELSE, got '-'
        {code}
        It seems that it's failing inside the second THEN

        This one also seems to fail:
        {code:sql}
        SUM(CASE
                    WHEN c.startDate <= :start THEN (c.endDate - :start)
                    WHEN c.endDate >= :end THEN (:end - c.startDate)
                    ELSE 0
                    END)
        {code}

        exception:
        {code}
        [Syntax Error] line 0, col 60: Error: Unexpected '('
        {code}

        Another one:
        {code:sql}
        SUM(CASE
                        WHEN c.startDate <= :start THEN c.endDate - :start
                        WHEN c.endDate >= :end THEN :end - c.startDate
                        ELSE 0
                        END) = :result FROM ...
        {code}

        exception:
        {code}
        [Syntax Error] line 0, col 60: Error: Expected Doctrine\ORM\Query\Lexer::T_FROM, got '='
        {code}
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 2.4 [ 10321 ]
        Resolution Fixed [ 1 ]
        Miha Vrhovnik made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        Guilherme Blanco made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Assignee Fabio B. Silva [ fabio.bat.silva ] Guilherme Blanco [ guilhermeblanco ]
        Resolution Won't Fix [ 2 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: