This used to work with 2.5.x:
$em->createQueryBuilder()
->delete(MyEntity::class)
->getQuery()
->execute();
Now with 2.6.0 I get this error:
[Syntax Error] line 0, col -1: Error: Expected Doctrine\ORM\Query\Lexer::T_IDENTIFIER, got end of string. (Doctrine\ORM\Query\QueryException)
If I add an alias it works again:
$em->createQueryBuilder()
->delete(MyEntity::class, 'e')
->getQuery()
->execute();
Is this BC break intentional?
Similar to #6932 (missing alias in SELECT, here it's FROM), it'll be caused by the same source.
As you can see here in EBNF for 2.5.0, alias is actually supposed to be mandatory.
It should probably be fixed for 2.6.
Can confirm the bug. I'm als affected with something like $em->createQuery('DELETE FROM '.MyEntity::class)->execute();.
I don't think the alias should be required for simple queries like this.
v2.6.x and v3.0Handled in #7077