Skip to content

Arithmetic expression inside round() leads to infinite parsing loop #474

@edas11

Description

@edas11

I tried using round function ROUND( 100 * SUM(intField1) / SUM(intField2), 2) (MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\Round) but it made while loop in \MartinGeorgiev\Doctrine\ORM\Query\AST\Functions\BaseVariadicFunction::feedParserWithNodesForNodeMappingPattern to run until timeout. I managed to make it work by adding additional parenthesis ROUND( ( 100 * SUM(cs.intField1) / SUM(cs.intField2) ), 2). However, it would be nice if round without additional parenthesis worked too. Not sure what is the best fix here. Maybe it needs to return ['SimpleArithmeticExpression'] from getNodeMappingPattern.

Version that I use:
doctrine/orm: 3.4.0
martin-georgiev/postgresql-for-doctrine: 3.5.0

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions