mirror of
https://github.com/php/php-src.git
synced 2024-12-14 04:16:30 +08:00
67bde2f8ac
bug46274.phpt and bug46274_2.phpt Make query silent (when server don't know bytea_output option) bug_49985.phpt Make result "locale" independent
36 lines
1000 B
PHP
36 lines
1000 B
PHP
--TEST--
|
|
Bug #49985 (pdo_pgsql prepare() re-use previous aborted transaction)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
|
|
require dirname(__FILE__) . '/config.inc';
|
|
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
|
PDOTest::skip();
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
|
|
$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
|
|
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
$db->exec("CREATE TABLE test (a int PRIMARY KEY)");
|
|
|
|
for ($i = 0; $i < 3; $i++) {
|
|
try {
|
|
$db->beginTransaction();
|
|
$stmt = $db->prepare("INSERT INTO test (a) VALUES (?)");
|
|
var_dump($stmt->execute(array(1)));
|
|
$db->commit();
|
|
} catch (Exception $e) {
|
|
echo trim(current(explode("\n", $e->getMessage())))."\n";
|
|
$db->rollback();
|
|
}
|
|
}
|
|
|
|
?>
|
|
--EXPECTF--
|
|
bool(true)
|
|
SQLSTATE[23505]: %stest_pkey%s
|
|
SQLSTATE[23505]: %stest_pkey%s
|
|
|