mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2229: Undefined method #2803
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 @doctrinebot on GitHub (Jan 9, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user drak:
There is an undefined method called in Doctrine\ORM\Query\SqlWalker
Fatal error: Call to undefined method Doctrine\ORM\Query\AST\PathExpression::isSimpleArithmeticExpression() in vendor\doctrine\orm\lib\Doctrine\ORM\Query\SqlWalker.php on line 2091
@doctrinebot commented on GitHub (Jan 12, 2013):
Comment created by @FabioBatSilva:
Hi Karma
Could you provide the failing DQL ?
Cheers
@doctrinebot commented on GitHub (Jan 18, 2013):
Comment created by drak:
It's generating SQL from a Doctrine Collection in a proxy class. Here is a link to the example: https://github.com/zikula/core/pull/674#discussion_r2696186
The SQL being generated is
The ? should be the value 2, but for some reason it's not being added. I've checked the files in the stack-trace below and the right values are entering into the process, just the wrong SQL seems to be generated.
Exception Trace
#0 Exception thrown in C:\xampp\htdocs\core13\src\vendor\doctrine\dbal\lib\Doctrine\DBAL\DBALException.php, line 47.
#1 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\BasicEntityPersister.php(1599): Doctrine\DBAL\Connection->executeQuery('SELECT t0.name ...', Array, Array)
#2 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\BasicEntityPersister.php(1558): Doctrine\ORM\Persisters\BasicEntityPersister->getOneToManyStatement(Array, Object(Users\Entity\User))
#3 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\UnitOfWork.php(2673): Doctrine\ORM\Persisters\BasicEntityPersister->loadOneToManyCollection(Array, Object(Users\Entity\User), Object(Doctrine\ORM\PersistentCollection))
#4 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\PersistentCollection.php(224): Doctrine\ORM\UnitOfWork->loadCollection(Object(Doctrine\ORM\PersistentCollection))
#5 C:\xampp\htdocs\core13\src\vendor\doctrine\orm\lib\Doctrine\ORM\PersistentCollection.php(576): Doctrine\ORM\PersistentCollection->initialize()
#6 C:\xampp\htdocs\core13\src\lib\util\UserUtil.php(1152): Doctrine\ORM\PersistentCollection->getIterator()
#7 C:\xampp\htdocs\core13\src\lib\util\UserUtil.php(2007): UserUtil::getVars('admin', false, 'uname', false)
@doctrinebot commented on GitHub (Jan 20, 2013):
Comment created by @FabioBatSilva:
Hi Drak,
Could you try to write a failing test case please ?
Cheers
@doctrinebot commented on GitHub (Feb 10, 2013):
Comment created by @asm89:
ping! :)
@doctrinebot commented on GitHub (Feb 14, 2013):
Comment created by hussdl:
SqlWalker::walkInExpression()does this:$sql = $this->walkArithmeticExpression($inExpr->expression)However,
$inExpr->expressioncould be an instance ofPathExpression. The grammar allows this case:sqlInExpression ::= SingleValuedPathExpression ["NOT"] "IN" "(" (InParameter {"," InParameter}* | Subselect) ")"PathExpressionandArithmeticExpressionboth extendNode, but aPathExpressionis not anArithmeticExpression, and therefore it has no methodisSimpleArithmeticExpression.If you still need a failing test case, I'll write one when I get home from work.
@doctrinebot commented on GitHub (Feb 14, 2013):
Comment created by @FabioBatSilva:
Please Daniel Huss, A test case will be very useful..
@doctrinebot commented on GitHub (Feb 15, 2013):
Comment created by hussdl:
failing test case
@doctrinebot commented on GitHub (Apr 2, 2013):
Comment created by hussdl:
Bug still present in release 2.3.3
Is someone taking care of this? It seems easy enough to fix.
@doctrinebot commented on GitHub (Apr 2, 2013):
Comment created by @ocramius:
[~hussdl] you can open a PR with the attached patch + test. Can you do it or should I take care of it?
@doctrinebot commented on GitHub (Apr 2, 2013):
Comment created by hussdl:
Please take care of it for me this time. I'd rather avoid the git setup until I have a significant contribution to make.
@doctrinebot commented on GitHub (Apr 8, 2013):
Comment created by @beberlei:
This is invalid, you need to set the path expression differently, this is pseudo code:
@doctrinebot commented on GitHub (Apr 8, 2013):
Issue was closed with resolution "Invalid"
@doctrinebot commented on GitHub (Apr 22, 2013):
Comment created by hussdl:
Could this be bug in the DQL grammar, then? If I'm not mistaken, the resolution of an InExpression cannot involve an ArithmeticPrimary non-terminal. I find the correct solution as shown by Benjamin Eberlei to be quite astonishing, since a path expression like "alias.field" is not something I'd associate with the term "arithmetic".