-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep track of whether we have fully consumed all result sets, either using nextRowset() calls or closeCursor() and skip the attempt to consume remaining results sets during destruction in that case. Especiall if closeCursor() has been used, we really shouldn't have this sort of cross-statement inference.
- Loading branch information
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--TEST-- | ||
Bug #66878: Multiple rowsets not returned unless PDO statement object is unset() | ||
--SKIPIF-- | ||
<?php | ||
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc'); | ||
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); | ||
MySQLPDOTest::skip(); | ||
?> | ||
--FILE-- | ||
<?php | ||
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); | ||
|
||
$pdo = MySQLPDOTest::factory(); | ||
|
||
$sql = 'SELECT 123; SELECT 42; SELECT 999'; | ||
|
||
$stmt = $pdo->query($sql); | ||
var_dump($stmt->nextRowset()); | ||
var_dump($stmt->nextRowset()); | ||
var_dump($stmt->nextRowset()); | ||
$stmt->closeCursor(); | ||
|
||
$stmt = $pdo->query($sql); | ||
var_dump($stmt->nextRowset()); | ||
var_dump($stmt->nextRowset()); | ||
var_dump($stmt->nextRowset()); | ||
$stmt->closeCursor(); | ||
|
||
?> | ||
--EXPECT-- | ||
bool(true) | ||
bool(true) | ||
bool(false) | ||
bool(true) | ||
bool(true) | ||
bool(false) |