ID: 37870
User updated by: sagi at adamnet dot co dot il
Reported By: sagi at adamnet dot co dot il
-Status: No Feedback
+Status: Open
Bug Type: PDO related
Operating System: Debian Sarge
-PHP Version: 5.1.4
+PHP Version: CVS
New Comment:
Same with the latest CVS version:
[EMAIL PROTECTED]:~/XXX/tmp$ /usr/local/php5-dev/bin/php -v
PHP 5.2.0RC3-dev (cli) (built: Aug 20 2006 12:46:20)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
[EMAIL PROTECTED]:~/XXX/tmp$ /usr/local/php5-dev/bin/php preptest.php
PHP Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current
transaction is aborted, commands ignored until end of transaction
block' in /home/XXX/tmp/preptest.php:13
Stack trace:
#0 /home/XXX/tmp/preptest.php(13): PDO->query('SELECT 123')
#1 {main}
thrown in /home/XXX/tmp/preptest.php on line 13
Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current
transaction is aborted, commands ignored until end of transaction
block' in /home/XXX/tmp/preptest.php:13
Stack trace:
#0 /home/XXX/tmp/preptest.php(13): PDO->query('SELECT 123')
#1 {main}
thrown in /home/XXX/tmp/preptest.php on line 13
[EMAIL PROTECTED]:~/XXX/tmp$
Previous Comments:
------------------------------------------------------------------------
[2006-08-10 01:00:00] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-08-02 14:18:38] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Appears to work fine (at least for me) in latest CVS.
------------------------------------------------------------------------
[2006-06-21 07:52:22] sagi at adamnet dot co dot il
Description:
------------
Using PHP 5.1.4 to connect to a postgresql 8.1.4 database, native
prepared statements.
When allocating a prepared statement and then trying to unset it, PDO
attemps to deallocate it even if it never been used (eg. when running a
query against an empty set).
PDO does not throw an exception in such case, but an error such as:
ERROR: prepared statement "pdo_pgsql_stmt_085b2f2c" does not exist
Appers in the server log.
When running inside a transaction, such error aborts it.
Reproduce code:
---------------
$pdo->beginTransaction();
$stmt = $pdo->prepare("SELECT 'never executed'");
unset($stmt);
$res = $pdo->query('SELECT 123');
Actual result:
--------------
PHP Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[25P02]: In failed sql transaction: 7 ERROR: current
transaction is aborted, commands ignored until end of transaction
block' in XXX:13
Stack trace:
#0 XXX: PDO->query('SELECT 123')
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37870&edit=1