DDC-1777: BasicEntityPersister::exists() creates broken SQL with inheritance #2235

Closed
opened 2026-01-22 13:45:47 +01:00 by admin · 5 comments
Owner

Originally created by @doctrinebot on GitHub (Apr 14, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user liwo:

The entity persister creates a sql query like SELECT 1 FROM table t0 WHERE t1.id = ?1 when trying to verify a subclass object exists in the database.
This cannot work as t1 from the where clause is not defined. Our particular case was with joined table inheritance.

Attached patch fixes the issue for us.

Originally created by @doctrinebot on GitHub (Apr 14, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user liwo: The entity persister creates a sql query like SELECT 1 FROM table t0 WHERE t1.id = ?1 when trying to verify a subclass object exists in the database. This cannot work as t1 from the where clause is not defined. Our particular case was with joined table inheritance. Attached patch fixes the issue for us.
admin added the Bug label 2026-01-22 13:45:47 +01:00
admin closed this issue 2026-01-22 13:45:48 +01:00
Author
Owner

@doctrinebot commented on GitHub (Apr 14, 2012):

@doctrinebot commented on GitHub (Apr 14, 2012): - is duplicated by [DDC-1841: Problem in the generation QUERY](http://www.doctrine-project.org/jira/browse/DDC-1841)
Author
Owner

@doctrinebot commented on GitHub (May 27, 2012):

Comment created by @beberlei:

I can't reproduce this. Can you provide the mapping details?

@doctrinebot commented on GitHub (May 27, 2012): Comment created by @beberlei: I can't reproduce this. Can you provide the mapping details?
Author
Owner

@doctrinebot commented on GitHub (Oct 6, 2012):

Comment created by @beberlei:

Cannot reproduce and no feedback given.

@doctrinebot commented on GitHub (Oct 6, 2012): Comment created by @beberlei: Cannot reproduce and no feedback given.
Author
Owner

@doctrinebot commented on GitHub (Oct 6, 2012):

Issue was closed with resolution "Cannot Reproduce"

@doctrinebot commented on GitHub (Oct 6, 2012): Issue was closed with resolution "Cannot Reproduce"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/5d80c2956a2203430399

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/5d80c2956a2203430399 - [11178_exists-with-inheritance.diff](https://gist.github.com/5d80c2956a2203430399#file-11178_exists-with-inheritance-diff)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2235