php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55826 Multiple PDORow's
Submitted: 2011-09-30 22:52 UTC Modified: 2013-10-15 11:54 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: grinyad at mail dot ru Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.3.8 OS: Windows XP
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-09-30 22:52 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-30 23:07 UTC] johannes@php.net
-Status: Open +Status: Analyzed
 [2011-09-30 23:07 UTC] 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-12-24 06:16 UTC] ssufficool at gmail dot com
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.
 [2013-06-12 05:01 UTC] ssufficool@php.net
The rows in your test script return distinct values for PDO_DBLIB in PHP5.4. 
Which specific PDO driver are you having problems with?
 [2013-06-12 05:02 UTC] ssufficool@php.net
-Status: Analyzed +Status: Feedback
 [2013-06-12 05:02 UTC] ssufficool@php.net
Please try using this snapshot:

  http://snaps.php.net/php5.4-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/


 [2013-10-15 11:54 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2013-10-15 12:04 UTC] grinyad at mail dot ru
the driver is pdo_mysql
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 21:01:29 2024 UTC