From:             sagi at adamnet dot co dot il
Operating system: Debian Sarge
PHP version:      5.1.4
PHP Bug Type:     PDO related
Bug description:  Deallocation of prepared statement that hasn't been allocated 
under postgresql

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 bug report at http://bugs.php.net/?id=37870&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37870&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=37870&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37870&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37870&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37870&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37870&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37870&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37870&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37870&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37870&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37870&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37870&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37870&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37870&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37870&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37870&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37870&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37870&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37870&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37870&r=mysqlcfg

Reply via email to