Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1978

SQLParserUtils array_fill tries to create array with zero elements when empty parameter is bound

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:

      Description

      When binding an empty array as a parameter (and specifying a parameter type to work around DDC-1977) SQLParserUtils::expandListParameters tries to use array_fill to generate an empty array.

      https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/SQLParserUtils.php#L127

      Pseudo-code that generated the bug:

      $this->getEntityManager()->createNativeQuery($query, $rsm)->setParameter(1, array())->getArrayResult();
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        A related Github Pull-Request [GH-425] was opened
        https://github.com/doctrine/doctrine2/pull/425

        Show
        Benjamin Eberlei added a comment - A related Github Pull-Request [GH-425] was opened https://github.com/doctrine/doctrine2/pull/425
        Hide
        Benjamin Eberlei added a comment -

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

        Show
        Benjamin Eberlei added a comment - A related Github Pull-Request [GH-425] was closed https://github.com/doctrine/doctrine2/pull/425
        Show
        Fabio B. Silva added a comment - Fixed by : https://github.com/doctrine/dbal/commit/24ec1947a83b82101845889ba4fc7f3cbd0e5a90
        Hide
        Doctrine Bot added a comment -

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

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

          People

          • Assignee:
            Fabio B. Silva
            Reporter:
            Matt Button
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: