Download src/php/php-src/ext/pdo_pgsql/tests/bug_49985.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_pgsql/tests/bug_49985.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/pdo_pgsql/tests/bug_49985.phpt
-
curl -L -o bug_49985.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/pdo_pgsql/tests/bug_49985.phpt
1.09 kB
| --TEST-- | |
| Bug #49985 (pdo_pgsql prepare() re-use previous aborted 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'; | |
| $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); | |
| $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
| $db->exec("CREATE TABLE b49985 (a int PRIMARY KEY)"); | |
| for ($i = 0; $i < 3; $i++) { | |
| try { | |
| $db->beginTransaction(); | |
| $stmt = $db->prepare("INSERT INTO b49985 (a) VALUES (?)"); | |
| var_dump($stmt->execute(array(1))); | |
| $db->commit(); | |
| } catch (Exception $e) { | |
| echo trim(current(explode("\n", $e->getMessage())))."\n"; | |
| $db->rollback(); | |
| } | |
| } | |
| --CLEAN-- | |
| require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc'; | |
| $db = PDOTest::test_factory(__DIR__ . '/common.phpt'); | |
| $db->query('DROP TABLE IF EXISTS b49985 CASCADE'); | |
| --EXPECTF-- | |
| bool(true) | |
| SQLSTATE[23505]: %sb49985_pkey%s | |
| SQLSTATE[23505]: %sb49985_pkey%s | |