Bug #55826 [Com]: Multiple PDORow's

From: Date: Sat, 24 Dec 2011 06:16:13 +0000
Subject: Bug #55826 [Com]: Multiple PDORow's
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-166067@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55826&edit=1

 ID:                 55826
 Comment by:         ssufficool at gmail dot com
 Reported by:        grinyad at mail dot ru
 Summary:            Multiple PDORow's
 Status:             Analyzed
 Type:               Bug
 Package:            PDO related
 Operating System:   Windows XP
 PHP Version:        5.3.8
 Block user comment: N
 Private report:     N

 New Comment:

Another issue with "fixing" this is that many databases (SQLServer) do not support
multiple active statements per a database handle/connection. It will throw an error stating there is
another active resultset.

So, 2 statements requires 2 connections.


Previous Comments:
------------------------------------------------------------------------
[2011-09-30 23:07:50] johannes@php.net

The issue here is that PDORow contains a pointer to the actual statement instance which is used to
receive the data and is then shared over the PDOStatement instance and all PDORows created from
there. Changing this is a large change wa can't do for 5.4, which is in beta. Given other
issues in there (see recent bug about serialization) I tend to removing it in 5.5, but am not sure
if it might bring notable benefits with some database drivers ...

------------------------------------------------------------------------
[2011-09-30 22:52:32] grinyad at mail dot ru

Description:
------------
You cant use multiple PDORow's at the same time.

Test script:
---------------
<?php

$row = $stmt->fetch(PDO::FETCH_LAZY);
print_r($row);
$row2 = $stmt->fetch(PDO::FETCH_LAZY);

print_r($row);
print_r($row2);
?>

$row => PDORow Object
(
    [queryString] => select acl.* from accesscontrollevel as acl
    [Id] => 2
    [Title] => Banned
)

$row => PDORow Object
        (
            [queryString] => select acl.* from accesscontrollevel as acl
            [Id] => 3
            [Title] => Member
        )

$row2 => PDORow Object
        (
            [queryString] => select acl.* from accesscontrollevel as acl
            [Id] => 3
            [Title] => Member
        )


$row and $row2 are the same as last fetch result $row2.I mean
that every PDORow Object will have the last fetch values. I think this is a bug.



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



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


Thread (7 messages)

« previous php.bugs (#166067) next »