ID: 37870 Updated by: [EMAIL PROTECTED] Reported By: sagi at adamnet dot co dot il -Status: Assigned +Status: Feedback Bug Type: PDO related Operating System: Debian Sarge PHP Version: 5.1.4 Assigned To: wez New Comment:
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. Previous Comments: ------------------------------------------------------------------------ [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