Edit report at https://bugs.php.net/bug.php?id=62803&edit=1

 ID:                 62803
 User updated by:    jackspr at hotmail dot com
 Reported by:        jackspr at hotmail dot com
 Summary:            nextRowset not returning false
 Status:             Open
 Type:               Bug
 Package:            PDO related
 Operating System:   Windows Server 2008
 PHP Version:        5.3.15
 Block user comment: N
 Private report:     N

 New Comment:

update


Previous Comments:
------------------------------------------------------------------------
[2012-08-12 16:06:11] jackspr at hotmail dot com

Description:
------------
---
>From manual page: http://www.php.net/pdostatement.nextrowset#refsect1-
pdostatement.nextrowset-seealso
---
nextRowset is not returning false. The code below causes an exception in the 
fetchAll line because it is trying to access a result set does not exist.

$r=0
$qy = "CALL getAllInfo()";
$istmt = $con->prepare($qy);
if ($istmt->execute())
{
        $outcome = self::SUCCESS;
        do 
        {                               
          $result[$r] = $istmt->fetchAll(PDO::FETCH_ASSOC);
          $r++;
        }
        while($istmt->nextRowset());
}

Test script:
---------------
$r=0
$qy = "CALL getAllInfo()";
$istmt = $con->prepare($qy);
if ($istmt->execute())
{
        $outcome = self::SUCCESS;
        do 
        {                               
          $result[$r] = $istmt->fetchAll(PDO::FETCH_ASSOC);
          $r++;
        }
        while($istmt->nextRowset());
}

Expected result:
----------------
Clean exit with all possible resultsets in the result array.

Actual result:
--------------
exception 'PDOException' with message 'SQLSTATE[HY000]: General error'


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62803&edit=1

Reply via email to