Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1539

QueryException occurs when parentheses exist on the left-hand of comparison

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: 2.2
    • Component/s: DQL
    • Security Level: All
    • Labels:
      None

      Description

      When I executed the following DQL, I get an error.

       
      > php scripts/doctrine.php orm:run-dql "select o from OrderDetail o where (o.price + o.tax) * o.count > 10000"
      
        [Doctrine\ORM\Query\QueryException]
        [Syntax Error] line 0, col 69: Error: Expected =, <, <=, <>, >, >=, !=, got ')'
      

      When I swap the left-hand expression and right-hand one, no error occurs.

      > php scripts/doctrine.php orm:run-dql "select o from OrderDetail o where 10000 < (o.price + o.tax) * o.count"
      
      array
        empty
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        This issue is referenced in Github Pull-Request GH-233
        https://github.com/doctrine/doctrine2/pull/233

        Show
        Benjamin Eberlei added a comment - This issue is referenced in Github Pull-Request GH-233 https://github.com/doctrine/doctrine2/pull/233
        Show
        Guilherme Blanco added a comment - Fixed in https://github.com/doctrine/doctrine2/commit/4bc014c6961be2e24b131d06d25c885fdf07bc3b
        Hide
        Benjamin Eberlei added a comment -

        Related Pull Request was closed: https://github.com/doctrine/doctrine2/pull/233

        Show
        Benjamin Eberlei added a comment - Related Pull Request was closed: https://github.com/doctrine/doctrine2/pull/233

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Koji Ando
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: