#36157 [NEW]: Introduce new PDO attribute to automatically close old statement.
From: fh at ez dot no
Operating system: Gentoo Linux
PHP version: 5.1.2
PHP Bug Type: Feature/Change Request
Bug description: Introduce new PDO attribute to automatically close old statement.
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.
--
Edit bug report at http://bugs.php.net/?id=36157&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36157&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36157&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36157&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36157&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=36157&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36157&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36157&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36157&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36157&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36157&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=36157&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=36157&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36157&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36157&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36157&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36157&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36157&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36157&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36157&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36157&r=mysqlcfg
Thread (4 messages)
- fh at ez dot no