|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-12-08 10:49 UTC] nikic@php.net
-Status: Open
+Status: Verified
[2020-12-08 10:49 UTC] nikic@php.net
[2020-12-09 15:38 UTC] nikic@php.net
[2020-12-09 15:38 UTC] nikic@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Description: ------------ Hey, Only the first multiple-result-set query on a given pdo connection works as expected; subsequent queries always claim to have only one result-set (although they have many). This does not happen if PDOStatement used to issue the query is unset(). The communication with the database is correct (checked with wireshark); this is an api issue. Test script: --------------- $sql = 'SELECT 123; SELECT 42; SELECT 999'; $pdo = new PDO('mysql:dbname=xxx;host=xxx', 'xxx', 'xxx'); $stmt = $pdo->query($sql); var_dump($stmt->nextRowset()); /* returns true, as expected */ var_dump($stmt->nextRowset()); /* returns true, as expected */ var_dump($stmt->nextRowset()); /* returns false, as expected */ $stmt->closeCursor(); /* unset($stmt); uncomment this line to make stuff "work" */ $stmt = $pdo->query($sql); var_dump($stmt->nextRowset()); /* expected: true; got: false */ var_dump($stmt->nextRowset()); /* expected: true; got: false */ var_dump($stmt->nextRowset()); $stmt->closeCursor(); /* unset($stmt); uncomment this line to make stuff "work" */ Expected result: ---------------- bool(true) bool(true) bool(false) bool(true) bool(true) bool(false) Actual result: -------------- bool(true) bool(true) bool(false) bool(false) bool(false) bool(false)