mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
ExpressionBuilder::between() returns string instead of Expression/Function #5541
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 @holtkamp on GitHub (May 18, 2017).
The PHPDoc suggests that a
BETWEENExpression is returned of typeExpr\Func, while it is a plain string. Is this intended behaviour?It seems this results in problems when using it in other Expressions like
andXandorX. Will try to come up with a test case.@lcobucci commented on GitHub (May 18, 2017):
@holtkamp thanks.
It seems to be a docblock error since we have strings for
isNull()andisNotNull(). Also we won't have any issue if the expression is a string:334b7e68a7/lib/Doctrine/ORM/Query/Expr/Base.php (L91)@holtkamp commented on GitHub (May 18, 2017):
@lcobucci thanks for the swift response.
For me it results in an error when using something like:
When assembling the SQL, this results in an exception:
@lcobucci commented on GitHub (May 19, 2017):
@holtkamp I've just tried to reproduce that on a test case (on
master) and that doesn't happen...Mapping:
Test:
Am I doing something different than you?
@holtkamp commented on GitHub (May 22, 2017):
@lcobucci you are right, with such an isolated case the problem does not occur, I tried to pinpoint the problem and it seems that something like this fails on
2.5.6:The query I am building checks whether a provided weekday is within a range, so:
Where
$weekdayis a string and either:WeekDay(CURRENT_TIMESTAMP()) + 1=> default: the current weekdayWeekDay(:weekdayParameter)=> specific, a specific date is used as parameterHowever, this succeeds:
So it has to do with the first parameters...
@holtkamp commented on GitHub (May 23, 2017):
@lcobucci can you push that testcase to master or a branch on your fork so I can fiddle with it as well?
@holtkamp commented on GitHub (Jun 24, 2017):
@lcobucci I had a look and came up with a failing test. For the second scenario depicted below, DQL generation seems to succeed and SQL generation fails on the current
masterbranch.Results in
@holtkamp commented on GitHub (Jul 12, 2017):
@lcobucci anything else I can do to help on this issue? My knowledge is too limited to come up with a PR to suggest a fix, but if someone gives me a pointer I can give it a try...
@lcobucci commented on GitHub (Jul 22, 2017):
@holtkamp sorry for not getting back to you, let's start PR with a failing test case (based on
master) and we try to fix it there. Can you please send it?@holtkamp commented on GitHub (Sep 19, 2017):
@lcobucci FYI: I added the requested PR some time ago, hopefully this properly points out the issue...
@lcobucci commented on GitHub (Sep 19, 2017):
@holtkamp sorry about my delay (again).
I saw the PR but I didn't manage to check it properly, it does seem to cover the issue though. Thanks!
@holtkamp commented on GitHub (Sep 19, 2017):
Ok, thanks for the update! Standing by 😄
@holtkamp commented on GitHub (Aug 14, 2019):
Minor bump on this? This issue is about a "bug".
3.0in https://github.com/doctrine/orm/pull/7184So I am not sure whether this bug issue can/should be closed?