DDC-856: Boolean discriminator field for single table inheritance does not work as expected with MySQL #1059

Closed
opened 2026-01-22 13:00:35 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 3, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user sebak:

Hello,

I have a a single table inheritance, with a boolean discriminator field, see: http://pastie.org/1269467
As MySQL does not have a boolean field, true / false should be translated to 1/0 (as it uses a TINYINT(1) field instead).

If I use 1 / 0 in the annotation instead of true / false it works, but than it's not boolean anymore...

So it should either translate that, or mention this in the documentation (although vendor specific exceptions should be avoided imo).

Originally created by @doctrinebot on GitHub (Nov 3, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user sebak: Hello, I have a a single table inheritance, with a boolean discriminator field, see: http://pastie.org/1269467 As MySQL does not have a boolean field, true / false should be translated to 1/0 (as it uses a TINYINT(1) field instead). If I use 1 / 0 in the annotation instead of true / false it works, but than it's not boolean anymore... So it should either translate that, or mention this in the documentation (although vendor specific exceptions should be avoided imo).
admin added the Bug label 2026-01-22 13:00:35 +01:00
admin closed this issue 2026-01-22 13:00:36 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 4, 2010):

Comment created by @beberlei:

This is not supported, i suggest using smallint and 0 / 1 instead.

@doctrinebot commented on GitHub (Nov 4, 2010): Comment created by @beberlei: This is not supported, i suggest using smallint and 0 / 1 instead.
Author
Owner

@doctrinebot commented on GitHub (Nov 11, 2010):

Comment created by @beberlei:

Throwing an exception now on using boolean, object, array, datetime, date or time for the discriminator column.

@doctrinebot commented on GitHub (Nov 11, 2010): Comment created by @beberlei: Throwing an exception now on using boolean, object, array, datetime, date or time for the discriminator column.
Author
Owner

@doctrinebot commented on GitHub (Nov 11, 2010):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Nov 11, 2010): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1059