forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgh7723.phpt
32 lines (31 loc) · 853 Bytes
/
gh7723.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--TEST--
GitHub #7723 (Fix error message allocation of PDO PgSQL)
--EXTENSIONS--
pdo
pdo_pgsql
--SKIPIF--
<?php
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
require __DIR__ . '/config.inc';
PDOTest::skip();
?>
--FILE--
<?php
require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
require __DIR__ . '/config.inc';
$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
$db->setAttribute(PDO::ATTR_PERSISTENT, true);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$st = $db->prepare('select 1');
for ($i = 0; ++$i <= 2;) {
try {
$st->bindValue(':invalid', $i);
} catch (PDOException $e) {
echo $e->getMessage() . "\n";
}
}
?>
--EXPECT--
SQLSTATE[HY093]: Invalid parameter number: :invalid
SQLSTATE[HY093]: Invalid parameter number: :invalid