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