xref: /PHP-8.2/ext/pdo_dblib/tests/bug_69757.phpt (revision 74859783)
1--TEST--
2PDO_DBLIB: Segmentation fault on pdo_dblib::nextRowset
3--EXTENSIONS--
4pdo_dblib
5--SKIPIF--
6<?php
7require __DIR__ . '/config.inc';
8?>
9--FILE--
10<?php
11require __DIR__ . '/config.inc';
12
13$sql = "
14    exec dbo.sp_executesql N'
15        SELECT TOP 1 * FROM sysobjects
16        SELECT TOP 1 * FROM syscolumns
17    '
18";
19$stmt = $db->query($sql);
20$resultset1 = $stmt->fetchAll(PDO::FETCH_ASSOC);
21if (true !== $stmt->nextRowset()) {
22    die('expect TRUE on nextRowset');
23}
24$resultset2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
25if (false !== $stmt->nextRowset()) {
26    die('expect FALSE on nextRowset');
27}
28$stmt->closeCursor();
29
30echo "OK\n";
31?>
32--EXPECT--
33OK
34