php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #36157 Introduce new PDO attribute to automatically close old statement.
Submitted: 2006-01-25 16:59 UTC Modified: 2011-01-02 02:18 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: fh at ez dot no Assigned:
Status: Open Package: PDO related
PHP Version: 5.1.2 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fh at ez dot no
New email:
PHP Version: OS:

 

 [2006-01-25 16:59 UTC] fh at ez dot no
Description:
------------
Currently when using the MySQL PDO driver, trying to 
execute a second statement while the first one is still 
active yields: 
SQLSTATE[HY000]: General error: 2014 Cannot execute 
queries while other unbuffered queries are active.Consider 
using PDOStatement::fetchAll().  Alternatively, if your 
code is only ever going to run against mysql, you may 
enable query buffering by setting the 
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. 
 
This is all well and good, but quite unhandy since it is 
inconsistent with e.g the postgres driver that does not 
suffer from this problem. It also makes it very hard e.g 
wrap the result of an SQL statement in an iterator since 
the user might break out of it. 
 
I propose to introduce a new attribute to PDO that force 
the drivers to automatically "flush" any open statements 
when a new one is executed. 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-02 02:18 UTC] jani@php.net
-Package: Feature/Change Request +Package: PDO related
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jan 24 03:01:24 2020 UTC