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

        Matt Button created issue -
        Matt Button made changes -
        Field Original Value New Value
        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:

        {code:php}
        $this->getEntityManager()->createNativeQuery($query, $rsm)->setParameter(1, array())->getArrayResult();
        {/code}
        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:

        {code}
        $this->getEntityManager()->createNativeQuery($query, $rsm)->setParameter(1, array())->getArrayResult();
        {/code}
        Matt Button made changes -
        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:

        {code}
        $this->getEntityManager()->createNativeQuery($query, $rsm)->setParameter(1, array())->getArrayResult();
        {/code}
        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:

        {code}
        $this->getEntityManager()->createNativeQuery($query, $rsm)->setParameter(1, array())->getArrayResult();
        {code}
        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
        Fabio B. Silva made changes -
        Assignee Benjamin Eberlei [ beberlei ] Fabio B. Silva [ fabio.bat.silva ]
        Fabio B. Silva made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Show
        Fabio B. Silva added a comment - Fixed by : https://github.com/doctrine/dbal/commit/24ec1947a83b82101845889ba4fc7f3cbd0e5a90
        Fabio B. Silva made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.4 [ 10321 ]
        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

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-1978, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: