ID:               37870
 Updated by:       [EMAIL PROTECTED]
 Reported By:      sagi at adamnet dot co dot il
-Status:           Open
+Status:           Assigned
 Bug Type:         PDO related
 Operating System: Debian Sarge
 PHP Version:      5.1.4
-Assigned To:      
+Assigned To:      wez


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

Reply via email to