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}
        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 ]
        Fabio B. Silva made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.4 [ 10321 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: