Bug #66878 [NEW]: Multiple rowsets not returned unless PDO statement object is unset()
From: wiktor dot janas at tensquaregames dot com
Operating system: Linux
PHP version: 5.4.26
Package: PDO MySQL
Bug Type: Bug
Bug description:Multiple rowsets not returned unless PDO statement object is unset()
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)
--
Edit bug report at https://bugs.php.net/bug.php?id=66878&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66878&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66878&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66878&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66878&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66878&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66878&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66878&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66878&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66878&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66878&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66878&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66878&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66878&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66878&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66878&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66878&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66878&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66878&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66878&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66878&r=mysqlcfg
Thread (3 messages)
- wiktor dot janas at tensquaregames dot com