Bug #54478 [NEW]: The pdo_pgsql specific implementation of inTransaction doesn't work as expected
| From: | phofstetter at sensational dot ch | Date: | Wed, 06 Apr 2011 12:59:12 +0000 |
| Subject: | Bug #54478 [NEW]: The pdo_pgsql specific implementation of inTransaction doesn't work as expected | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-159978@lists.php.net to get a copy of this message | ||
From:
Operating system: OSX, Linux, likely all
PHP version: 5.3.6
Package: PDO related
Bug Type: Bug
Bug description:The pdo_pgsql specific implementation of inTransaction doesn't work as expected
Description:
------------
PHP 5.3.3 supposedly brought PDO::inTransaction() with a special
implementation
for PostgreSQL wich uses libpq's PQtransactionStatus instead of internal
bookkeeping.
According to the test attached with the revision where this was added
(is_in_transaction.phpt, revision 300351), inTransaction() is supposed to
return
any of the PGSQL_TRANSACTION_* constants.
Unfortunately that's not the case and inTransaction(), even when used in
conjunction with PostgreSQL only returns boolean and doesn't use the actual
transaction status of the connection but just returns true or false
depending on
whether PDO::beginTransaction() has been called or not.
PHP's own test runner illustrates the problem, which is why I don't bother
adding an additional test script - the included is_in_transaction.phpt is
enough:
http://gcov.php.net/viewer.php?
version=PHP_5_3&func=tests&file=ext%2Fpdo_pgsql%2Ftests%2Fis_in_transaction.phpt
Expected result:
----------------
When running the phpt file, I expect the following output:
Test PDO::PGSQL_TRANSACTION_INTRANS
int(2)
Test PDO::PGSQL_TRANSACTION_IDLE
int(0)
Test PDO::PGSQL_TRANSACTION_INERROR
int(3)
Test PDO::PGSQL_TRANSACTION_IDLE
int(0)
Actual result:
--------------
When running the phpt file, I (and PHP's webbased test runner) is getting
Test PDO::PGSQL_TRANSACTION_INTRANS
int(1)
Test PDO::PGSQL_TRANSACTION_IDLE
int(0)
Test PDO::PGSQL_TRANSACTION_INERROR
int(1)
Test PDO::PGSQL_TRANSACTION_IDLE
int(0)
--
Edit bug report at http://bugs.php.net/bug.php?id=54478&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54478&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54478&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54478&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54478&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54478&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54478&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54478&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54478&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54478&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54478&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54478&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54478&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54478&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54478&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54478&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54478&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54478&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54478&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54478&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54478&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54478&r=mysqlcfg