xref: /php-src/ext/pdo_pgsql/tests/bug72570.phpt (revision 6fb81d23)
1--TEST--
2PDO PgSQL Bug #72570 (Segmentation fault when binding parameters on a query without placeholders)
3--EXTENSIONS--
4pdo_pgsql
5--SKIPIF--
6<?php
7require __DIR__ . '/config.inc';
8require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
9PDOTest::skip();
10?>
11--FILE--
12<?php
13require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
14$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
15$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
16
17$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
18
19$stmt = $db->prepare("SELECT 1");
20
21try {
22    var_dump($stmt->execute([1]));
23} catch (PDOException $e) {
24    var_dump($e->getCode());
25}
26
27?>
28--EXPECT--
29string(5) "08P01"
30