Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #37870 : Deallocation of prepared statement that hasn't been allocated under postgresql
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 23rd August 22:32
iliaa
External User
 
Posts: 1
Default #37870 : Deallocation of prepared statement that hasn't been allocated under postgresql



ID: 37870
Updated by: iliaa@php.net
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 ***:13
Stack trace:
#0 ***: PDO->query('SELECT 123')

------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=37870&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666