xref: /PHP-8.4/ext/pdo_dblib/tests/bug_67130.phpt (revision d6a0b3af)
1--TEST--
2PDO_DBLIB: \PDOStatement::nextRowset() should succeed when all rows in current rowset haven't been fetched
3--EXTENSIONS--
4pdo_dblib
5--SKIPIF--
6<?php
7require __DIR__ . '/config.inc';
8getDbConnection();
9?>
10--FILE--
11<?php
12require __DIR__ . '/config.inc';
13
14$db = getDbConnection();
15
16$stmt = $db->query('SELECT 1; SELECT 2; SELECT 3;');
17var_dump($stmt->fetch());
18var_dump($stmt->fetch());
19var_dump($stmt->nextRowset());
20var_dump($stmt->nextRowset());
21var_dump($stmt->fetch());
22var_dump($stmt->nextRowset());
23?>
24--EXPECT--
25array(2) {
26  ["computed"]=>
27  int(1)
28  [0]=>
29  int(1)
30}
31bool(false)
32bool(true)
33bool(true)
34array(2) {
35  ["computed"]=>
36  int(3)
37  [0]=>
38  int(3)
39}
40bool(false)
41