]> granicus.if.org Git - php/commitdiff
testcase fot bug #69757
authorMiRacLe.RPZ <miracle@rpz.name>
Mon, 6 Jul 2015 20:31:57 +0000 (23:31 +0300)
committerAnatol Belski <ab@php.net>
Sun, 18 Oct 2015 09:10:39 +0000 (11:10 +0200)
ext/pdo_dblib/tests/bug_69757.phpt [new file with mode: 0644]

diff --git a/ext/pdo_dblib/tests/bug_69757.phpt b/ext/pdo_dblib/tests/bug_69757.phpt
new file mode 100644 (file)
index 0000000..6c4aee0
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+PDO_DBLIB: Segmentation fault on pdo_dblib::nextRowset
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo_dblib')) die('skip not loaded');
+require __DIR__ . '/config.inc';
+?>
+--FILE--
+<?php
+require __DIR__ . '/config.inc';
+
+$sql = "
+    exec dbo.sp_executesql N'
+        SELECT * FROM sysobjects
+        SELECT * FROM syscolumns
+    '
+";
+$stmt = $db->query($sql);
+$resultset1 = $stmt->fetchAll(PDO::FETCH_ASSOC);
+if (true !== $stmt->nextRowset()) {
+    die('expect TRUE on nextRowset');
+}
+$resultset2 = $stmt->fetchAll(PDO::FETCH_ASSOC);
+if (false !== $stmt->nextRowset()) {
+    die('expect FALSE on nextRowset');
+}
+$stmt->closeCursor();
+
+echo "OK\n";
+?>
+--EXPECT--
+OK