mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Fix broken assert(is_numeric($sql)) in DateAddFunction and DateSubFunction #7313
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 @ondrejmirtes on GitHub (Feb 9, 2024).
Bug Report
Summary
I'm working on ORM 3 and DBAL 4 support on phpstan-doctrine, and I have this test case:
Doctrine crashes on this line:
5a40b99e11/src/Query/AST/Functions/DateAddFunction.php (L74)The
$sqlvalue is:m0_.intColumn.I think the
assertassumption is wrong, asintervaldoes not have to refer to a scalar value, but can be a column as well. The job of this part of the codebase is to just generate the correct SQL query to execute against the database.Same problem is in DateSubFunction too.
Current behavior
Expected behavior
It should work and generate the right SQL.
@derrabus commented on GitHub (Feb 9, 2024):
That looks like a valid bug. PR welcome if someone wants to give it a try before I find the time.
@ondrejmirtes commented on GitHub (Feb 9, 2024):
I'm trying: https://github.com/doctrine/orm/pull/11243