mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
No table name escape in ServiceEntityRepository->createQueryBuilder() #6214
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 @Oihso on GitHub (Mar 31, 2019).
Originally assigned to: @Ocramius on GitHub.
Bug Report
Summary
If you have entity, that named like SQL keyword (
Orderin my case), you can not use$this->createQueryBuilder('...')->...;because after building the query you getSELECT ... FROM order ...query which always has non-escaped table name. As a result, you cant access table with that name.How to reproduce
$this->createQueryBuilder('...')->...;P.S. Not sure, if this 'bug' relates to this repository, and not to doctrine/orm
@ostrolucky commented on GitHub (Apr 1, 2019):
Please try with master, one of the major changes is precisely escaping stuff like that. Will not be fixed in 2.x due to bc concerns
Edit: and yes, this relates to orm. Try master version of orm
@Ocramius commented on GitHub (Apr 1, 2019):
Closing here: this is documented at https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/limitations-and-known-issues.html#identifier-quoting-and-legacy-databases