PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_pgsql/tests/bug67462.phpt ('PDO PgSQL Bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception when not in transaction)')

Script

1: <?php
2:
3:
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
4:
$pdo PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
5:
$pdo->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
6:
7:
$pdo->beginTransaction();
8:
9: try {
10:     
$pdo->query("CREATE TABLE b67462 (a int NOT NULL PRIMARY KEY DEFERRABLE INITIALLY DEFERRED)");
11:     
$pdo->query("INSERT INTO b67462 VALUES (1), (1)");
12:
13:     
var_dump($pdo->inTransaction());
14:     
$pdo->commit(); // This should fail!
15:
} catch (\Exception $e) {
16:     
var_dump($pdo->inTransaction());
17:     
var_dump($pdo->beginTransaction());
18: }
19:
20:
?>
21:

Expected

bool(true)
bool(false)
bool(true)

Output

bool(true)

Fatal error: Uncaught exception 'PDOException' with message 'There is already an active transaction' in /var/php_gcov/PHP_5_6/ext/pdo_pgsql/tests/bug67462.php:17
Stack trace:
#0 /var/php_gcov/PHP_5_6/ext/pdo_pgsql/tests/bug67462.php(17): PDO->beginTransaction()
#1 {main}
  thrown in /var/php_gcov/PHP_5_6/ext/pdo_pgsql/tests/bug67462.php on line 17

Diff

002+ 
003+ Fatal error: Uncaught exception 'PDOException' with message 'There is already an active transaction' in /var/php_gcov/PHP_5_6/ext/pdo_pgsql/tests/bug67462.php:17
002- bool(false)
003- bool(true)
004+ Stack trace:
005+ #0 /var/php_gcov/PHP_5_6/ext/pdo_pgsql/tests/bug67462.php(17): PDO->beginTransaction()
006+ #1 {main}
007+   thrown in /var/php_gcov/PHP_5_6/ext/pdo_pgsql/tests/bug67462.php on line 17

 

Generated at Mon, 27 Nov 2017 05:04:32 +0000 (13 days ago)

Copyright © 2005-2017 The PHP Group
All rights reserved.