php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64055 nextRowset() returns false
Submitted: 2013-01-23 11:03 UTC Modified: 2020-03-22 07:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: kenji dot uui at gmail dot com Assigned: cmb (profile)
Status: Closed Package: PDO MySQL
PHP Version: 5.3.21 OS: Ubuntu
Private report: No CVE-ID: None
 [2013-01-23 11:03 UTC] kenji dot uui at gmail dot com
Description:
------------
The below code expects 3 result sets, but only 2 returned.


Test script:
---------------
<?php

$db = new PDO('mysql:host=localhost;dbname=information_schema', 'root', '');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$sql = <<<SQL
SELECT * FROM CHARACTER_SETS WHERE CHARACTER_SET_NAME = 'sjis';
SELECT * FROM CHARACTER_SETS WHERE CHARACTER_SET_NAME = 'utf8';
SELECT * FROM CHARACTER_SETS WHERE CHARACTER_SET_NAME = 'ujis';
SQL;
$result = $db->query($sql);
$i = 1;
do {
  echo "<br />";
  echo "Result set ", $i++, ":\n"; 
  print_r($result->fetchAll());
} while ($result->nextRowset());


Expected result:
----------------
Result set 1: Array ( [0] => Array ( [CHARACTER_SET_NAME] => sjis [0] => sjis [DEFAULT_COLLATE_NAME] => sjis_japanese_ci [1] => sjis_japanese_ci [DESCRIPTION] => Shift-JIS Japanese [2] => Shift-JIS Japanese [MAXLEN] => 2 [3] => 2 ) )
Result set 2: Array ( [0] => Array ( [CHARACTER_SET_NAME] => utf8 [0] => utf8 [DEFAULT_COLLATE_NAME] => utf8_general_ci [1] => utf8_general_ci [DESCRIPTION] => UTF-8 Unicode [2] => UTF-8 Unicode [MAXLEN] => 3 [3] => 3 ) )
Result set 3: Array ( [0] => Array ( [CHARACTER_SET_NAME] => ujis [0] => ujis [DEFAULT_COLLATE_NAME] => ujis_japanese_ci [1] => ujis_japanese_ci [DESCRIPTION] => EUC-JP Japanese [2] => EUC-JP Japanese [MAXLEN] => 3 [3] => 3 ) ) 

Actual result:
--------------
Result set 1: Array ( [0] => Array ( [CHARACTER_SET_NAME] => sjis [0] => sjis [DEFAULT_COLLATE_NAME] => sjis_japanese_ci [1] => sjis_japanese_ci [DESCRIPTION] => Shift-JIS Japanese [2] => Shift-JIS Japanese [MAXLEN] => 2 [3] => 2 ) )
Result set 2: Array ( [0] => Array ( [CHARACTER_SET_NAME] => utf8 [0] => utf8 [DEFAULT_COLLATE_NAME] => utf8_general_ci [1] => utf8_general_ci [DESCRIPTION] => UTF-8 Unicode [2] => UTF-8 Unicode [MAXLEN] => 3 [3] => 3 ) ) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-01 12:34 UTC] felipe@php.net
-Package: PDO related +Package: PDO MySQL
 [2020-03-13 15:32 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-03-13 15:32 UTC] cmb@php.net
I cannot reproduce this; I get 3 result sets (PHP-7.3 and PHP-7.4
on Windows with mysqlnd).  Does this fail for you with any of the
actively supported PHP versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2020-03-22 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 [2020-03-22 07:00 UTC] kenji dot uui at gmail dot com
-Status: No Feedback +Status: Closed
 [2020-03-22 07:00 UTC] kenji dot uui at gmail dot com
I was not able to reproduce this bug with PHP 7.3 on Linux.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 10:01:26 2024 UTC