Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-856

Boolean discriminator field for single table inheritance does not work as expected with MySQL

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA4
    • Fix Version/s: 2.0-RC1
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None
    • Environment:
      MySQL 5

      Description

      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).

        Activity

        Hide
        beberlei Benjamin Eberlei added a comment -

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

        Show
        beberlei Benjamin Eberlei added a comment - This is not supported, i suggest using smallint and 0 / 1 instead.
        Hide
        beberlei Benjamin Eberlei added a comment -

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

        Show
        beberlei Benjamin Eberlei added a comment - Throwing an exception now on using boolean, object, array, datetime, date or time for the discriminator column.

          People

          • Assignee:
            beberlei Benjamin Eberlei
            Reporter:
            sebak seba kerckhof
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: