mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
using aliases from select clause in having clause does not work #6077
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Sep 26, 2018).
Originally assigned to: @Ocramius on GitHub.
Bug Report
Using aliases from select clause in having clause throw an exception.
Summary
I am trying call a function created function in Entity Repository
I'm using a berberlei bundle who's have create most needed DQL function to doctrine. The function date seems well
Throw an exception, because the column name is an alias and not really exist.
How to reproduce
https://github.com/helmidridi/doctrine_undefined_index_metadata
@Ocramius commented on GitHub (Sep 26, 2018):
What version does this affect?
@ghost commented on GitHub (Sep 26, 2018):
composer.zip
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
@Ocramius commented on GitHub (Sep 26, 2018):
Can you please try
^2.6.2?@ghost commented on GitHub (Sep 27, 2018):
Symfony 3.4 use doctrine ^2.5, I will open the new issue in Symfony framework
@Ocramius commented on GitHub (Sep 27, 2018):
No, the issue is here - Symfony simply supports installing older versions of
doctrine/orm, but you should really upgrade to latest available version before reporting a bug.@ghost commented on GitHub (Sep 27, 2018):
Yes i confirm still exists in 2.6.2
i updated the projet "How to reproduce" in github
@Ocramius commented on GitHub (Sep 27, 2018):
Can you port your test into a test case like in
b40c2c6b78/tests/Doctrine/Tests/ORM/Functional/Ticket? Seeb40c2c6b78/CONTRIBUTING.md (tests)@ghost commented on GitHub (Sep 28, 2018):
DDC7414Test.php
You need to install beberlei/DoctrineExtensions or just add the function Date to doctrine project.
@ghost commented on GitHub (Sep 28, 2018):
I included the function directly in the test
@Ocramius commented on GitHub (Sep 28, 2018):
Is it not possible to reproduce the problem without DoctrineExtensions?
@Ocramius commented on GitHub (Sep 28, 2018):
For instance, since an
ArithmeticPrimaryis requested in that location, wouldHAVING bill_date > 'foo'suffice?@ghost commented on GitHub (Sep 28, 2018):
You don't need doctrine extension I included a DQL "DATE" function directly in the test File DDC7414Test.php. I have no bug without using a DQL function.
HAVING bill_date > 'foo'return just a QueryException@ghost commented on GitHub (Sep 30, 2018):
It's not a bug, sorry. After having read the source code it has become clear that this is a problem due to that the date function of beberlei extension expects to have a column and parse an "ArithmeticPrimary" but alias is a String type. I'm going to create my own DATE function and parse a "StringExpression" it solves the problem.
@Ocramius commented on GitHub (Sep 30, 2018):
Closing as per https://github.com/doctrine/doctrine2/issues/7414#issuecomment-425750000