xref: /PHP-7.4/ext/pdo_pgsql/tests/bug61267.phpt (revision 26dfce7f)
1--TEST--
2PDO::exec() returns 0 when the statement is a SELECT.
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo') || !extension_loaded('pdo_pgsql')) die('skip not loaded');
6require_once __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
7require_once __DIR__ . '/config.inc';
8PDOTest::skip();
9?>
10--FILE--
11<?php
12require_once __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
13require_once __DIR__ . '/config.inc';
14$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
15
16$res = $db->exec('SELECT * from generate_series(1, 42);');
17var_dump($res);
18echo "Done\n";
19?>
20--EXPECT--
21int(0)
22Done
23