mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Query builder yields invalid SQL with JOINED inheritance type on PostgreSQL #5552
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 @stesie on GitHub (May 22, 2017).
Originally assigned to: @Ocramius on GitHub.
Given a simple set of entities (adapted to a simpler domain here):
Postbelongs to anAuthorwhich derives fromUserPostandAuthoris not mapped (for reasons, as the real case is less simple)If I then instanciate and use a QueryBuilder like this:
it generates the following SQL
Which is valid for MySQL, however is not valid for PostgreSQL (tried with 9.6)
PostgreSQL seems to require an
ONclause with each and everyINNER JOIN(interestingly as opposed toLEFT JOIN). This is, the following query works with it:Pushing all conditions to
WHEREalso works on PostgreSQL:I haven't yet dug deeper, mainly as I never dived into Doctrine ORM code ... please let me know if you agree on this being a bug, ... I so far have no idea where it goes wrong, but let me know if I can support you, maybe by providing test code or start digging ...