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