Details

    • Type: Bug
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3, 2.4.2
    • Fix Version/s: 2.3.3
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      Column type json_array can be set to nullable, but if there's null in the database, it is returned as an empty array to PHP.

      Null should be returned instead, as that's how the other types behave too.

        Issue Links

          Activity

          Hide
          beberlei Benjamin Eberlei added a comment -

          This was fixed in 2.3.3

          Show
          beberlei Benjamin Eberlei added a comment - This was fixed in 2.3.3
          Hide
          wildlyinaccurate Joseph Wynn added a comment -

          I'm seeing this behaviour again in v2.5.0-BETA3 (6d0b048). If I get time this week I can perform a bisect to figure out when it regressed.

          Show
          wildlyinaccurate Joseph Wynn added a comment - I'm seeing this behaviour again in v2.5.0-BETA3 (6d0b048). If I get time this week I can perform a bisect to figure out when it regressed.
          Hide
          wildlyinaccurate Joseph Wynn added a comment -

          Actually I don't think this was a regression; it looks like a fix was never made. I've opened a PR: https://github.com/doctrine/dbal/pull/655

          Show
          wildlyinaccurate Joseph Wynn added a comment - Actually I don't think this was a regression; it looks like a fix was never made. I've opened a PR: https://github.com/doctrine/dbal/pull/655
          Hide
          doctrinebot Doctrine Bot added a comment -

          A related Github Pull-Request [GH-655] was closed:
          https://github.com/doctrine/dbal/pull/655

          Show
          doctrinebot Doctrine Bot added a comment - A related Github Pull-Request [GH-655] was closed: https://github.com/doctrine/dbal/pull/655
          Hide
          doctrinebot Doctrine Bot added a comment -

          A related Github Pull-Request [GH-655] was assigned:
          https://github.com/doctrine/dbal/pull/655

          Show
          doctrinebot Doctrine Bot added a comment - A related Github Pull-Request [GH-655] was assigned: https://github.com/doctrine/dbal/pull/655
          Hide
          ocramius Marco Pivetta added a comment -

          Re-opened, as this behavior seems reproducible also in 2.4.x

          Show
          ocramius Marco Pivetta added a comment - Re-opened, as this behavior seems reproducible also in 2.4.x
          Hide
          deeky666 Steve Müller added a comment -

          It was never fixed. That seems to have been a misunderstanding here. As pointed out by Marco Pivetta changing this behaviour is a BC break and can't be fixed before 3.0.

          Show
          deeky666 Steve Müller added a comment - It was never fixed. That seems to have been a misunderstanding here. As pointed out by Marco Pivetta changing this behaviour is a BC break and can't be fixed before 3.0.
          Hide
          frickenate Nate Bessette added a comment -

          I spent the time to develop a custom data type to workaround this bug: https://frickenate.com/2014/10/json-data-type-doctrine/ . I can't imagine anybody storing null expecting to receive back an empty array. That would be a fundamental break from the very purpose of the SQL NULL value.

          Show
          frickenate Nate Bessette added a comment - I spent the time to develop a custom data type to workaround this bug: https://frickenate.com/2014/10/json-data-type-doctrine/ . I can't imagine anybody storing null expecting to receive back an empty array. That would be a fundamental break from the very purpose of the SQL NULL value.

            People

            • Assignee:
              ocramius Marco Pivetta
              Reporter:
              hrubi Jan Hruban
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: