[PR #5598] HAVING clause with variable and *, / math operators #9664

Open
opened 2026-01-22 16:05:01 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/doctrine/orm/pull/5598

State: closed
Merged: No


This is integrated and completed in #5599

I've produced a test for bug #4764

As this regression highlights, this bug happens only with the * and / math operators used in the HAVING clause with variables from the SELECT clause; + and - math operators are fine.

Input DQL:

SELECT COUNT(u.name) AS countName FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING 1  / countName > 0

Expected:

SELECT COUNT(c0_.name) AS sclr_0 FROM cms_users c0_ HAVING 1 / sclr_0 > 0

Instead:

SELECT COUNT(c0_.name) AS sclr_0 FROM cms_users c0_ HAVING 1 / countName > 0
**Original Pull Request:** https://github.com/doctrine/orm/pull/5598 **State:** closed **Merged:** No --- **This is integrated and completed in #5599** I've produced a test for bug #4764 As this regression highlights, this bug happens only with the `*` and `/` math operators used in the `HAVING` clause with variables from the `SELECT` clause; `+` and `-` math operators are fine. Input DQL: ``` SELECT COUNT(u.name) AS countName FROM Doctrine\Tests\Models\CMS\CmsUser u HAVING 1 / countName > 0 ``` Expected: ``` SELECT COUNT(c0_.name) AS sclr_0 FROM cms_users c0_ HAVING 1 / sclr_0 > 0 ``` Instead: ``` SELECT COUNT(c0_.name) AS sclr_0 FROM cms_users c0_ HAVING 1 / countName > 0 ```
admin added the pull-request label 2026-01-22 16:05:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#9664