xref: /PHP-8.3/ext/pdo_mysql/tests/bug66878.phpt (revision b5a14e6c)
1--TEST--
2Bug #66878: Multiple rowsets not returned unless PDO statement object is unset()
3--EXTENSIONS--
4pdo_mysql
5--SKIPIF--
6<?php
7require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
8MySQLPDOTest::skip();
9?>
10--FILE--
11<?php
12require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
13
14$pdo = MySQLPDOTest::factory();
15
16$sql = 'SELECT 123; SELECT 42; SELECT 999';
17
18$stmt = $pdo->query($sql);
19var_dump($stmt->nextRowset());
20var_dump($stmt->nextRowset());
21var_dump($stmt->nextRowset());
22$stmt->closeCursor();
23
24$stmt = $pdo->query($sql);
25var_dump($stmt->nextRowset());
26var_dump($stmt->nextRowset());
27var_dump($stmt->nextRowset());
28$stmt->closeCursor();
29
30?>
31--EXPECT--
32bool(true)
33bool(true)
34bool(false)
35bool(true)
36bool(true)
37bool(false)
38