DDC-3800 #1441 INSTANCE OF now behaves correctly by including all possible child classes in IN() filtering conditions #4657

Closed
opened 2026-01-22 14:46:54 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 29, 2015).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of taueres:

Url: https://github.com/doctrine/doctrine2/pull/1441

Message:

There was a bug in the "INSTANCE OF" operator as described in
https://groups.google.com/forum/#!topic/doctrine-user/B8raq8CNMgg

"INSTANCE OF" was not taking into account subclasses.
It was merely translating the class to its discriminator.
This is not correct since the class can have subtypes and those
are, indeed, still instance of the superclass.
Also, classes may not have a discriminator (e.g. abstract classes).

This commit also provide useful tests to avoid regression.

Originally created by @doctrinebot on GitHub (Jun 29, 2015). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of taueres: Url: https://github.com/doctrine/doctrine2/pull/1441 Message: There was a bug in the "INSTANCE OF" operator as described in https://groups.google.com/forum/#!topic/doctrine-user/B8raq8CNMgg "INSTANCE OF" was not taking into account subclasses. It was merely translating the class to its discriminator. This is not correct since the class can have subtypes and those are, indeed, still instance of the superclass. Also, classes may not have a discriminator (e.g. abstract classes). This commit also provide useful tests to avoid regression.
admin added the Bug label 2026-01-22 14:46:54 +01:00
admin closed this issue 2026-01-22 14:46:55 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4657