xref: /php-src/ext/pdo_dblib/tests/bug_69757.phpt (revision d6a0b3af)
1--TEST--
2PDO_DBLIB: Segmentation fault on pdo_dblib::nextRowset
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$sql = "
17    exec dbo.sp_executesql N'
18        SELECT TOP 1 * FROM sysobjects
19        SELECT TOP 1 * FROM syscolumns
20    '
21";
22$stmt = $db->query($sql);
23$resultset1 = $stmt->fetchAll(PDO::FETCH_ASSOC);
24if (true !== $stmt->nextRowset()) {
25    die('expect TRUE on nextRowset');
26}
27$resultset2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
28if (false !== $stmt->nextRowset()) {
29    die('expect FALSE on nextRowset');
30}
31$stmt->closeCursor();
32
33echo "OK\n";
34?>
35--EXPECT--
36OK
37