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