Download src/php/php-src/ext/pdo_pgsql/tests/bug67462.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_pgsql/tests/bug67462.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo_pgsql/tests/bug67462.phpt
-
curl -L -o bug67462.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_pgsql/tests/bug67462.phpt
1.07 kB
| --TEST-- | |
| PDO PgSQL Bug #67462 (PDO_PGSQL::beginTransaction() wrongly throws exception when not in transaction) | |
| --EXTENSIONS-- | |
| pdo_pgsql | |
| --SKIPIF-- | |
| require __DIR__ . '/config.inc'; | |
| require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; | |
| PDOTest::skip(); | |
| --FILE-- | |
| require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; | |
| $pdo = PDOTest::test_factory(__DIR__ . '/common.phpt'); | |
| $pdo->setAttribute (\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); | |
| $pdo->beginTransaction(); | |
| try { | |
| $pdo->query("CREATE TABLE test67462 (a int NOT NULL PRIMARY KEY DEFERRABLE INITIALLY DEFERRED)"); | |
| $pdo->query("INSERT INTO test67462 VALUES (1), (1)"); | |
| var_dump($pdo->inTransaction()); | |
| $pdo->commit(); // This should fail! | |
| } catch (\Exception $e) { | |
| var_dump($pdo->inTransaction()); | |
| var_dump($pdo->beginTransaction()); | |
| } | |
| --CLEAN-- | |
| require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; | |
| $pdo = PDOTest::test_factory(__DIR__ . '/common.phpt'); | |
| $pdo->query("DROP TABLE IF EXISTS test67462"); | |
| --EXPECT-- | |
| bool(true) | |
| bool(false) | |
| bool(true) | |