mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
SubQuery in addSelect with Alias #6408
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 @ybenhssaien on GitHub (Feb 21, 2020).
Bug Report
Summary
Creating a subquery in addSelect with alias, generates syntax error while it shouldn't

Current behavior
Working with QueryBuilder to construct a parent query with subqueries in columns :
How to reproduce
Create subqueries in select columns with alias.
Expected behavior
@ybenhssaien commented on GitHub (Feb 26, 2020):
Solution : without using
$qb->expr()->literal(), only assert that all whitespace characters are replace by a non withespace character like_usingpreg_replaceor equivalent :@beberlei commented on GitHub (Mar 1, 2020):
Yes, the bug is that you used literal for the aliases, they are not literals.
@ybenhssaien commented on GitHub (Mar 2, 2020):
Even without literal is not working :
So it is a bug !